Skip to content

Commit

Permalink
Bump to two hours
Browse files Browse the repository at this point in the history
  • Loading branch information
nattsw committed Aug 15, 2023
1 parent 8913c46 commit d493359
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/jobs/scheduled/enqueue_reminders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def allowed_group_ids
Group.assign_allowed_groups.pluck(:id).join(",")
end

REMINDER_BUFFER_MINUTES = 60
REMINDER_BUFFER_MINUTES = 120

def user_ids
global_frequency = SiteSetting.remind_assigns_frequency
Expand Down
8 changes: 6 additions & 2 deletions spec/jobs/scheduled/enqueue_reminders_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
user.custom_fields[
PendingAssignsReminder::REMINDERS_FREQUENCY
] = RemindAssignsFrequencySiteSettings::DAILY_MINUTES
user.custom_fields[PendingAssignsReminder::REMINDED_AT] = 1.days.ago + 59.minutes
user.custom_fields[PendingAssignsReminder::REMINDED_AT] = 1.days.ago +
(Jobs::EnqueueReminders::REMINDER_BUFFER_MINUTES - 1)
user.save

assign_multiple_tasks_to(user, assigned_on: 2.day.ago)
Expand All @@ -61,7 +62,10 @@
end

it "does not enqueue a reminder if it's too soon" do
user.upsert_custom_fields(PendingAssignsReminder::REMINDED_AT => 1.days.ago + 60.minutes)
user.upsert_custom_fields(
PendingAssignsReminder::REMINDED_AT =>
1.days.ago + Jobs::EnqueueReminders::REMINDER_BUFFER_MINUTES,
)
assign_multiple_tasks_to(user)

assert_reminders_enqueued(0)
Expand Down

0 comments on commit d493359

Please sign in to comment.