From 62881262a0ed97ce40ccf25f3288d4f7f90b380e Mon Sep 17 00:00:00 2001 From: akadusei Date: Mon, 4 Dec 2023 08:29:37 +0000 Subject: [PATCH] Set task run time earlier Related to commit 406b83e982cb766871e125b237e4ee3a1e9daef3. --- src/worker/task.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/worker/task.cr b/src/worker/task.cr index 163d917..fe45eee 100644 --- a/src/worker/task.cr +++ b/src/worker/task.cr @@ -3,13 +3,13 @@ require "./task/**" abstract class Mel::Task def run(*, force = false) : Fiber? return log_not_due unless force || due? - do_before_run + self.attempts += 1 + set_run_time spawn(name: id) do log_running - set_run_time job.run rescue error log_errored(error)