From 1450bf5483305894063345673b9c3202d54c4bc3 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 25 Feb 2023 02:45:22 +0000 Subject: [PATCH] Remove Job::delay_seconds() It always returned 0 for added jobs. --- src/job.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/job.rs b/src/job.rs index 4ba203823..ff37ea543 100644 --- a/src/job.rs +++ b/src/job.rs @@ -98,10 +98,6 @@ impl Job { } } - pub fn delay_seconds(&self) -> i64 { - self.desired_timestamp - self.added_timestamp - } - /// Deletes the job from the database. async fn delete(self, context: &Context) -> Result<()> { if self.job_id != 0 { @@ -298,13 +294,10 @@ pub(crate) async fn schedule_resync(context: &Context) -> Result<()> { /// Adds a job to the database, scheduling it. pub async fn add(context: &Context, job: Job) -> Result<()> { - let delay_seconds = job.delay_seconds(); job.save(context).await.context("failed to save job")?; - if delay_seconds == 0 { - info!(context, "interrupt: imap"); - context.interrupt_inbox(InterruptInfo::new(false)).await; - } + info!(context, "interrupt: imap"); + context.interrupt_inbox(InterruptInfo::new(false)).await; Ok(()) }