mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-26 00:05:28 +00:00
fix jobs in scheduler
This commit is contained in:
parent
22c80c260f
commit
c8accd5618
1 changed files with 4 additions and 4 deletions
|
@ -290,10 +290,10 @@ func enqueueSubreddits(ctx context.Context, logger *zap.Logger, statsd *statsd.C
|
|||
batchIds[i] = strconv.FormatInt(id, 10)
|
||||
}
|
||||
|
||||
jobs := make([]*faktory.Job, len(batchIds)*2)
|
||||
for i, id := range ids {
|
||||
jobs[i*2] = faktory.NewJob("SubredditWatcherJob", id)
|
||||
jobs[i*2+1] = faktory.NewJob("SubredditTrendingJob", id)
|
||||
jobs := []*faktory.Job{}
|
||||
for _, id := range ids {
|
||||
jobs = append(jobs, faktory.NewJob("SubredditWatcherJob", id))
|
||||
jobs = append(jobs, faktory.NewJob("SubredditTrendingJob", id))
|
||||
}
|
||||
if _, err := fc.PushBulk(jobs); err != nil {
|
||||
logger.Error("failed to enqueue subreddit batch", zap.Error(err))
|
||||
|
|
Loading…
Reference in a new issue