From e80579ed3597c56e6879c0db79b01cb3ad890f2c Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Wed, 13 Jul 2022 12:19:07 -0400 Subject: [PATCH] tweak batch sizes --- internal/cmd/scheduler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index 295292d..e2c00cd 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -25,8 +25,8 @@ import ( ) const ( - batchSize = 1000 - maxNotificationChecks = 5000 + batchSize = 100 + maxNotificationChecks = 500 ) func SchedulerCmd(ctx context.Context) *cobra.Command { @@ -93,7 +93,7 @@ func SchedulerCmd(ctx context.Context) *cobra.Command { } s := gocron.NewScheduler(time.UTC) - _, _ = s.Every(500).Milliseconds().Do(func() { enqueueAccounts(ctx, logger, statsd, db, redis, luaSha, notifQueue) }) + _, _ = s.Every(100).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) })