change notification interval to 10 seconds

This commit is contained in:
Andre Medeiros 2022-11-10 12:05:57 -05:00
parent d6b967188c
commit 7582c90468
2 changed files with 5 additions and 5 deletions

View file

@ -102,7 +102,7 @@ func SchedulerCmd(ctx context.Context) *cobra.Command {
s := gocron.NewScheduler(time.UTC) s := gocron.NewScheduler(time.UTC)
s.SetMaxConcurrentJobs(8, gocron.WaitMode) 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() eaj.SingletonMode()
_, _ = s.Every(5).Seconds().Do(func() { enqueueSubreddits(ctx, logger, statsd, db, []rmq.Queue{subredditQueue, trendingQueue}) }) _, _ = s.Every(5).Seconds().Do(func() { enqueueSubreddits(ctx, logger, statsd, db, []rmq.Queue{subredditQueue, trendingQueue}) })

View file

@ -9,7 +9,7 @@ import (
) )
const ( const (
NotificationCheckInterval = 5 * time.Second // time between notification checks NotificationCheckInterval = 10 * time.Second // time between notification checks
NotificationCheckTimeout = 5 * time.Minute // time before we give up an account check lock NotificationCheckTimeout = 5 * time.Minute // time before we give up an account check lock
StuckNotificationCheckInterval = 2 * time.Minute // time between stuck notification checks 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 StaleTokenThreshold = 2 * time.Hour // time an oauth token has to be expired for to be stale