Skip to content

Commit

Permalink
Apply @ulferts feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mereghost committed May 21, 2024
1 parent abcd5e2 commit e24081a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
3 changes: 3 additions & 0 deletions app/workers/mails/reminder_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

class Mails::ReminderJob < Mails::DeliverJob
include ::Notifications::WithMarkedNotifications
include GoodJob::ActiveJobExtensions::Concurrency

good_job_control_concurrency_with total_limit: 1

private

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ module Notifications
class CreateDateAlertsNotificationsJob < ApplicationJob
include GoodJob::ActiveJobExtensions::Concurrency

good_job_control_concurrency_with(
enqueue_limit: 1,
perform_limit: 1
)

retry_on GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError,
wait: 5.minutes,
attempts: 3
good_job_control_concurrency_with total_limit: 1

def perform(user)
return unless EnterpriseToken.allows_to?(:date_alerts)
Expand Down
4 changes: 0 additions & 4 deletions app/workers/work_packages/apply_working_days_change_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ class WorkPackages::ApplyWorkingDaysChangeJob < ApplicationJob
total_limit: 1
)

retry_on GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError,
wait: 5.minutes,
attempts: 3

def perform(user_id:, previous_working_days:, previous_non_working_days:)
user = User.find(user_id)

Expand Down
2 changes: 1 addition & 1 deletion app/workers/work_packages/progress/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ class WorkPackages::Progress::Job < ApplicationJob

retry_on GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError,
wait: 5.minutes,
attempts: 3
attempts: :unlimited
end

0 comments on commit e24081a

Please sign in to comment.