Skip to content

Commit

Permalink
fix twice cron jobs in queue
Browse files Browse the repository at this point in the history
  • Loading branch information
maatinito committed Dec 9, 2023
1 parent 972e915 commit e65d51c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/jobs/cron/cron_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ def schedulable?

def schedule
remove if cron_expression_changed?
Delayed::Job.enqueue(self.new, cron: self.cron_expression) if !scheduled?
display_schedule
if !scheduled?
self.set(cron: self.cron_expression).perform_later
display_schedule
end
end

def remove
Expand Down

0 comments on commit e65d51c

Please sign in to comment.