diff --git a/clock.rb b/clock.rb index c927e308de6f..5c21b9a55079 100644 --- a/clock.rb +++ b/clock.rb @@ -18,11 +18,11 @@ module Clockwork # NOTE: All clocks run every hour to take customer timezones into account - every(5.minutes, 'schedule:activate_subscriptions') do - Clock::ActivateSubscriptionsJob - .set(sentry: {"slug" => 'lago_activate_subscriptions', "cron" => '*/5 * * * *'}) - .perform_later - end + # every(5.minutes, 'schedule:activate_subscriptions') do + # Clock::ActivateSubscriptionsJob + # .set(sentry: {"slug" => 'lago_activate_subscriptions', "cron" => '*/5 * * * *'}) + # .perform_later + # end every(5.minutes, 'schedule:refresh_draft_invoices') do Clock::RefreshDraftInvoicesJob diff --git a/config/queue.yml b/config/queue.yml index d566bce55378..6d96c95dff49 100644 --- a/config/queue.yml +++ b/config/queue.yml @@ -18,5 +18,8 @@ development: test: <<: *default +staging: + <<: *default + production: <<: *default diff --git a/config/recurring.yml b/config/recurring.yml index d045b1914772..73e8e04f4fef 100644 --- a/config/recurring.yml +++ b/config/recurring.yml @@ -1,10 +1,17 @@ -# production: -# periodic_cleanup: -# class: CleanSoftDeletedRecordsJob -# queue: background -# args: [ 1000, { batch_size: 500 } ] -# schedule: every hour -# periodic_command: -# command: "SoftDeletedRecord.due.delete_all" -# priority: 2 -# schedule: at 5am every day +default: &default + activate_subscriptions: + class: Clock::ActivateSubscriptionsJob + queue: clock + schedule: every 5 minutes + +development: + <<: *default + +test: + <<: *default + +staging: + <<: *default + +production: + <<: *default diff --git a/scripts/start.worker.dev.sh b/scripts/start.worker.dev.sh index 8b0a2532d045..43b7e711aeda 100755 --- a/scripts/start.worker.dev.sh +++ b/scripts/start.worker.dev.sh @@ -1,4 +1,4 @@ #!/bin/bash bundle install -bin/jobs -c config/queue.yml +bin/jobs -c config/queue.yml --recurring-schedule-file=config/recurring.yml diff --git a/scripts/start.worker.sh b/scripts/start.worker.sh index 1ae744872d53..628d6dcf98d9 100755 --- a/scripts/start.worker.sh +++ b/scripts/start.worker.sh @@ -1,3 +1,3 @@ #!/bin/bash -bin/jobs -c config/queue.yml +bin/jobs -c config/queue.yml --recurring_schedule_file=config/recurring.yml