From eed3a33fee111e10c2bafbec4e579adae507fe7e Mon Sep 17 00:00:00 2001 From: Guillaume MORET <90462045+AyakorK@users.noreply.github.com> Date: Fri, 3 Jan 2025 12:02:35 +0100 Subject: [PATCH] backport: Add missing jobs for initiatives rake tasks (#97) --- app/jobs/check_published_initiatives.rb | 7 +++++++ app/jobs/check_validating_initiatives.rb | 7 +++++++ app/jobs/notify_progress_initiatives.rb | 7 +++++++ config/sidekiq.yml | 13 +++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 app/jobs/check_published_initiatives.rb create mode 100644 app/jobs/check_validating_initiatives.rb create mode 100644 app/jobs/notify_progress_initiatives.rb diff --git a/app/jobs/check_published_initiatives.rb b/app/jobs/check_published_initiatives.rb new file mode 100644 index 0000000..14e46fd --- /dev/null +++ b/app/jobs/check_published_initiatives.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class CheckPublishedInitiatives < ApplicationJob + def perform + system "rake decidim_initiatives:check_published" + end +end diff --git a/app/jobs/check_validating_initiatives.rb b/app/jobs/check_validating_initiatives.rb new file mode 100644 index 0000000..eac6e40 --- /dev/null +++ b/app/jobs/check_validating_initiatives.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class CheckValidatingInitiatives < ApplicationJob + def perform + system "rake decidim_initiatives:check_validating" + end +end diff --git a/app/jobs/notify_progress_initiatives.rb b/app/jobs/notify_progress_initiatives.rb new file mode 100644 index 0000000..d8ebc0a --- /dev/null +++ b/app/jobs/notify_progress_initiatives.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class NotifyProgressInitiatives < ApplicationJob + def perform + system "rake decidim_initiatives:notify_progress" + end +end diff --git a/config/sidekiq.yml b/config/sidekiq.yml index 8811244..06078ad 100644 --- a/config/sidekiq.yml +++ b/config/sidekiq.yml @@ -13,6 +13,7 @@ - metrics - vote_reminder - reminders + - initiatives :scheduler: :schedule: @@ -48,3 +49,15 @@ cron: '0 5 0 * * 6' # Run at 00:05 on Saturday class: SendNotificationMailWeeklyJob queue: mailers + CheckPublishedInitiatives: + cron: '0 1 * * *' + class: CheckPublishedInitiatives + queue: initiatives + CheckValidatingInitiatives: + cron: '0 1 * * *' + class: CheckValidatingInitiatives + queue: initiatives + NotifyProgressInitiatives: + cron: '0 1 * * *' + class: NotifyProgressInitiatives + queue: initiatives