From 6ece4c784a70f43699d1bd31cf431c0b732314a6 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Fri, 27 May 2022 16:12:50 -0400 Subject: [PATCH] no singleton --- internal/cmd/scheduler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index 9c2cdd9..e1414e9 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -24,7 +24,7 @@ import ( ) const ( - batchSize = 200 + batchSize = 1000 maxNotificationChecks = 5000 ) @@ -92,7 +92,7 @@ func SchedulerCmd(ctx context.Context) *cobra.Command { } s := gocron.NewScheduler(time.UTC) - _, _ = s.Every(100).Milliseconds().SingletonMode().Do(func() { enqueueAccounts(ctx, logger, statsd, db, redis, luaSha, notifQueue) }) + _, _ = s.Every(500).Milliseconds().Do(func() { enqueueAccounts(ctx, logger, statsd, db, redis, luaSha, notifQueue) }) _, _ = s.Every(5).Second().Do(func() { enqueueSubreddits(ctx, logger, statsd, db, []rmq.Queue{subredditQueue, trendingQueue}) }) _, _ = s.Every(5).Second().Do(func() { enqueueUsers(ctx, logger, statsd, db, userQueue) }) _, _ = s.Every(5).Second().Do(func() { cleanQueues(logger, queue) })