From 7582c9046837b419dcc99408eff57927c50bedb9 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Thu, 10 Nov 2022 12:05:57 -0500 Subject: [PATCH] change notification interval to 10 seconds --- internal/cmd/scheduler.go | 2 +- internal/domain/account.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index 10b442d..ec1549e 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -102,7 +102,7 @@ func SchedulerCmd(ctx context.Context) *cobra.Command { s := gocron.NewScheduler(time.UTC) s.SetMaxConcurrentJobs(8, gocron.WaitMode) - eaj, _ := s.Every(5).Seconds().Do(func() { enqueueAccounts(ctx, logger, statsd, db, redis, luaSha, notifQueue) }) + eaj, _ := s.Every(10).Seconds().Do(func() { enqueueAccounts(ctx, logger, statsd, db, redis, luaSha, notifQueue) }) eaj.SingletonMode() _, _ = s.Every(5).Seconds().Do(func() { enqueueSubreddits(ctx, logger, statsd, db, []rmq.Queue{subredditQueue, trendingQueue}) }) diff --git a/internal/domain/account.go b/internal/domain/account.go index a38154a..f32bf9c 100644 --- a/internal/domain/account.go +++ b/internal/domain/account.go @@ -9,10 +9,10 @@ import ( ) const ( - NotificationCheckInterval = 5 * time.Second // time between notification checks - NotificationCheckTimeout = 5 * time.Minute // time before we give up an account check lock - StuckNotificationCheckInterval = 2 * time.Minute // time between stuck notification checks - StaleTokenThreshold = 2 * time.Hour // time an oauth token has to be expired for to be stale + NotificationCheckInterval = 10 * time.Second // time between notification checks + NotificationCheckTimeout = 5 * time.Minute // time before we give up an account check lock + StuckNotificationCheckInterval = 2 * time.Minute // time between stuck notification checks + StaleTokenThreshold = 2 * time.Hour // time an oauth token has to be expired for to be stale ) // Account represents an account we need to periodically check in the notifications worker.