Revert "try enqueue accounts in a loop instead"

This reverts commit 9b5829f549.
This commit is contained in:
Andre Medeiros 2022-05-27 15:02:57 -04:00
parent 01ad9f3d1e
commit 0938400dd7

View file

@ -92,13 +92,7 @@ func SchedulerCmd(ctx context.Context) *cobra.Command {
}
s := gocron.NewScheduler(time.UTC)
go func() {
for {
enqueueAccounts(ctx, logger, statsd, db, redis, luaSha, notifQueue)
time.Sleep(100 * time.Millisecond)
}
}()
//_, _ = s.Every(100).Milliseconds().SingletonMode().Do(func() { enqueueAccounts(ctx, logger, statsd, db, redis, luaSha, notifQueue) })
_, _ = s.Every(100).Milliseconds().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) })
_, _ = s.Every(5).Second().Do(func() { cleanQueues(logger, queue) })