mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-15 00:17:42 +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)
|
batchIds[i] = strconv.FormatInt(id, 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
jobs := make([]*faktory.Job, len(batchIds)*2)
|
jobs := []*faktory.Job{}
|
||||||
for i, id := range ids {
|
for _, id := range ids {
|
||||||
jobs[i*2] = faktory.NewJob("SubredditWatcherJob", id)
|
jobs = append(jobs, faktory.NewJob("SubredditWatcherJob", id))
|
||||||
jobs[i*2+1] = faktory.NewJob("SubredditTrendingJob", id)
|
jobs = append(jobs, faktory.NewJob("SubredditTrendingJob", id))
|
||||||
}
|
}
|
||||||
if _, err := fc.PushBulk(jobs); err != nil {
|
if _, err := fc.PushBulk(jobs); err != nil {
|
||||||
logger.Error("failed to enqueue subreddit batch", zap.Error(err))
|
logger.Error("failed to enqueue subreddit batch", zap.Error(err))
|
||||||
|
|
Loading…
Reference in a new issue