This commit is contained in:
asonix 2022-11-17 23:55:29 -06:00
parent 51afbc89ce
commit 9c77c20883
2 changed files with 5 additions and 13 deletions

View file

@ -5,7 +5,7 @@ use time::{Duration, OffsetDateTime};
use tracing::trace;
use uuid::Uuid;
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
/// Information about the sate of an attempted job
pub struct ReturnJobInfo {
pub(crate) id: Uuid,
@ -35,7 +35,7 @@ impl ReturnJobInfo {
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
/// Information about a newly created job
pub struct NewJobInfo {
/// Name of the job
@ -113,7 +113,7 @@ impl NewJobInfo {
}
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
/// Metadata pertaining to a job that exists within the background_jobs system
///
/// Although exposed publically, this type should only really be handled by the library itself, and

View file

@ -258,11 +258,7 @@ pub mod memory_storage {
self.timer.timeout(
duration,
inner
.queues
.entry(queue.to_string())
.or_insert(Event::new())
.listen(),
inner.queues.entry(queue.to_string()).or_default().listen(),
)
};
@ -275,11 +271,7 @@ pub mod memory_storage {
inner.job_queues.insert(id, queue.to_owned());
inner
.queues
.entry(queue.to_string())
.or_insert(Event::new())
.notify(1);
inner.queues.entry(queue.to_string()).or_default().notify(1);
Ok(())
}