Fix job queue api
authorChocobozzz <me@florianbigard.com>
Wed, 7 Feb 2018 09:32:14 +0000 (10:32 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 7 Feb 2018 09:32:14 +0000 (10:32 +0100)
server/lib/job-queue/job-queue.ts

index e8f6c36203f7c8d81fb3633fd520c24dc49eab56..521d609cbdfbbf0448912b6bbc8ce8e072a2eb75 100644 (file)
@@ -83,7 +83,7 @@ class JobQueue {
 
   listForApi (state: JobState, start: number, count: number, sort: string) {
     return new Promise<kue.Job[]>((res, rej) => {
-      kue.Job.rangeByState(state, start, count, sort, (err, jobs) => {
+      kue.Job.rangeByState(state, start, start + count, sort, (err, jobs) => {
         if (err) return rej(err)
 
         return res(jobs)