From d01261a228fd6cda693623a85832bd567693512e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 31 Jul 2017 11:51:43 -0400 Subject: PLT-7177: Change the default email frequency to 15 minutes if batching is enabled on the server. (#7036) * PLT-7177: Found default preference that needs to be changed * PLT-7177: Front end behaves as desired * PLT-7177: Changed default batching interval on server side * PLT-7177: Added unit tests for new default interval * PLT-7177: Removed unused import * PLT-7177: Renamed constants to increase clarity --- app/email_batching.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/email_batching.go') diff --git a/app/email_batching.go b/app/email_batching.go index 5e4a36daf..e69870814 100644 --- a/app/email_batching.go +++ b/app/email_batching.go @@ -140,13 +140,14 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu // get how long we need to wait to send notifications to the user var interval int64 if result := <-pchan; result.Err != nil { - // default to 30 seconds to match the send "immediate" setting - interval, _ = strconv.ParseInt(model.PREFERENCE_DEFAULT_EMAIL_INTERVAL, 10, 64) + // use the default batching interval if an error ocurrs while fetching user preferences + interval, _ = strconv.ParseInt(model.PREFERENCE_EMAIL_INTERVAL_BATCHING_SECONDS, 10, 64) } else { preference := result.Data.(model.Preference) if value, err := strconv.ParseInt(preference.Value, 10, 64); err != nil { - interval, _ = strconv.ParseInt(model.PREFERENCE_DEFAULT_EMAIL_INTERVAL, 10, 64) + // // use the default batching interval if an error ocurrs while deserializing user preferences + interval, _ = strconv.ParseInt(model.PREFERENCE_EMAIL_INTERVAL_BATCHING_SECONDS, 10, 64) } else { interval = value } -- cgit v1.2.3-1-g7c22