DEV: Increase the buffer used to determine whether to send out the reminder email (#499)
Increase the buffer used to determine whether to send out the reminder email
This commit is contained in:
parent
f5cc748986
commit
55f8d24b1f
|
@ -20,7 +20,7 @@ module Jobs
|
|||
Group.assign_allowed_groups.pluck(:id).join(",")
|
||||
end
|
||||
|
||||
REMINDER_BUFFER_MINUTES = 10
|
||||
REMINDER_BUFFER_MINUTES = 120
|
||||
|
||||
def user_ids
|
||||
global_frequency = SiteSetting.remind_assigns_frequency
|
||||
|
|
|
@ -52,16 +52,20 @@ RSpec.describe Jobs::EnqueueReminders do
|
|||
user.custom_fields[
|
||||
PendingAssignsReminder::REMINDERS_FREQUENCY
|
||||
] = RemindAssignsFrequencySiteSettings::DAILY_MINUTES
|
||||
user.custom_fields[PendingAssignsReminder::REMINDED_AT] = 1.days.ago
|
||||
user.custom_fields[PendingAssignsReminder::REMINDED_AT] = 1.days.ago +
|
||||
(Jobs::EnqueueReminders::REMINDER_BUFFER_MINUTES - 1)
|
||||
user.save
|
||||
|
||||
assign_multiple_tasks_to(user, assigned_on: 1.day.ago - 1.minute)
|
||||
assign_multiple_tasks_to(user, assigned_on: 2.day.ago)
|
||||
|
||||
assert_reminders_enqueued(1)
|
||||
end
|
||||
|
||||
it "does not enqueue a reminder if it's too soon" do
|
||||
user.upsert_custom_fields(PendingAssignsReminder::REMINDED_AT => 1.days.ago)
|
||||
user.upsert_custom_fields(
|
||||
PendingAssignsReminder::REMINDED_AT =>
|
||||
1.days.ago + Jobs::EnqueueReminders::REMINDER_BUFFER_MINUTES,
|
||||
)
|
||||
assign_multiple_tasks_to(user)
|
||||
|
||||
assert_reminders_enqueued(0)
|
||||
|
|
Loading…
Reference in New Issue