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