2018-06-27 07:31:41 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-30 13:05:20 +00:00
|
|
|
module MailScheduler
|
2020-02-19 18:09:10 +00:00
|
|
|
class IssueDueWorker # rubocop:disable Scalability/IdempotentWorker
|
2018-03-30 13:05:20 +00:00
|
|
|
include ApplicationWorker
|
2021-04-30 18:10:09 +00:00
|
|
|
|
|
|
|
sidekiq_options retry: 3
|
2018-03-30 13:05:20 +00:00
|
|
|
include MailSchedulerQueue
|
|
|
|
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :issue_tracking
|
|
|
|
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2018-03-30 13:05:20 +00:00
|
|
|
def perform(project_id)
|
|
|
|
Issue.opened.due_tomorrow.in_projects(project_id).preload(:project).find_each do |issue|
|
|
|
|
notification_service.issue_due(issue)
|
|
|
|
end
|
|
|
|
end
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2018-03-30 13:05:20 +00:00
|
|
|
end
|
|
|
|
end
|