2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class IssueDueSchedulerWorker # rubocop:disable Scalability/IdempotentWorker
|
2018-03-30 13:05:20 +00:00
|
|
|
include ApplicationWorker
|
2021-04-30 18:10:09 +00:00
|
|
|
|
2021-07-21 12:09:35 +00:00
|
|
|
data_consistency :always
|
|
|
|
|
2020-02-04 15:08:40 +00:00
|
|
|
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
|
2018-03-30 13:05:20 +00:00
|
|
|
|
2021-10-27 15:13:41 +00:00
|
|
|
feature_category :team_planning
|
2019-10-18 11:11:44 +00:00
|
|
|
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2018-03-30 13:05:20 +00:00
|
|
|
def perform
|
2018-04-17 11:44:45 +00:00
|
|
|
project_ids = Issue.opened.due_tomorrow.group(:project_id).pluck(:project_id).map { |id| [id] }
|
|
|
|
|
2020-02-04 15:08:40 +00:00
|
|
|
MailScheduler::IssueDueWorker.bulk_perform_async(project_ids) # rubocop:disable Scalability/BulkPerformWithContext
|
2018-03-30 13:05:20 +00:00
|
|
|
end
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2018-03-30 13:05:20 +00:00
|
|
|
end
|