1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
# frozen_string_literal: true
module MailScheduler
class IssueDueWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
data_consistency :always
sidekiq_options retry: 3
include MailSchedulerQueue
feature_category :team_planning
# rubocop: disable CodeReuse/ActiveRecord
def perform(project_id)
Issue
.with_issue_type(:issue)
.opened
.due_tomorrow
.in_projects(project_id)
.preload(:project)
.find_each do |issue|
notification_service.issue_due(issue)
end
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
|