From 2c31a0df84639c6c3733fa4fb893fc3f73320ef3 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Thu, 27 Oct 2022 10:09:40 -0400 Subject: [PATCH] increase cron concurrent jobs --- internal/cmd/scheduler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index 309b94f..b7c9cea 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -97,6 +97,8 @@ func SchedulerCmd(ctx context.Context) *cobra.Command { } s := gocron.NewScheduler(time.UTC) + s.SetMaxConcurrentJobs(8, gocron.WaitMode) + _, _ = s.Every(5).Seconds().SingletonMode().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) })