Skip to content

Commit

Permalink
Set task run time earlier
Browse files Browse the repository at this point in the history
Related to commit 406b83e.
  • Loading branch information
akadusei committed Dec 4, 2023
1 parent 6f1e87c commit 6288126
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/worker/task.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6288126

Please sign in to comment.