debian-mirror-gitlab/app/workers/issue_due_scheduler_worker.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
603 B
Ruby
Raw Permalink Normal View History

2018-11-08 19:23:39 +05:30
# frozen_string_literal: true
2020-04-08 14:13:33 +05:30
class IssueDueSchedulerWorker # rubocop:disable Scalability/IdempotentWorker
2018-10-15 14:42:47 +05:30
include ApplicationWorker
2021-06-08 01:23:25 +05:30
2021-10-27 15:23:28 +05:30
data_consistency :always
2020-03-13 15:44:24 +05:30
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
2018-10-15 14:42:47 +05:30
2021-12-11 22:18:48 +05:30
feature_category :team_planning
2019-12-21 20:55:43 +05:30
2018-12-05 23:21:45 +05:30
# rubocop: disable CodeReuse/ActiveRecord
2018-10-15 14:42:47 +05:30
def perform
project_ids = Issue.opened.due_tomorrow.group(:project_id).pluck(:project_id).map { |id| [id] }
2020-03-13 15:44:24 +05:30
MailScheduler::IssueDueWorker.bulk_perform_async(project_ids) # rubocop:disable Scalability/BulkPerformWithContext
2018-10-15 14:42:47 +05:30
end
2018-12-05 23:21:45 +05:30
# rubocop: enable CodeReuse/ActiveRecord
2018-10-15 14:42:47 +05:30
end