diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-27 17:42:32 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-27 17:42:32 +0100 |
commit | 628d28e84ba49f4214cfe4946cbaf0a9f799929a (patch) | |
tree | 5d92bf8a153d7c3c4b7d46fae49581719b89b90e | |
parent | c90f0614e6edaae4939e521605a65fe186c37442 (diff) | |
download | PeerTube-628d28e84ba49f4214cfe4946cbaf0a9f799929a.tar.gz PeerTube-628d28e84ba49f4214cfe4946cbaf0a9f799929a.tar.zst PeerTube-628d28e84ba49f4214cfe4946cbaf0a9f799929a.zip |
Fix typings
-rw-r--r-- | server/lib/job-queue/job-queue.ts | 6 | ||||
-rw-r--r-- | server/lib/redis.ts | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index b0ccbd59c..66cced59a 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as kue from 'kue' | 1 | import * as kue from 'kue' |
2 | import { JobType, JobState } from '../../../shared/models' | 2 | import { JobState, JobType } from '../../../shared/models' |
3 | import { logger } from '../../helpers/logger' | 3 | import { logger } from '../../helpers/logger' |
4 | import { CONFIG, JOB_ATTEMPTS, JOB_COMPLETED_LIFETIME, JOB_CONCURRENCY } from '../../initializers' | 4 | import { CONFIG, JOB_ATTEMPTS, JOB_COMPLETED_LIFETIME, JOB_CONCURRENCY } from '../../initializers' |
5 | import { Redis } from '../redis' | 5 | import { Redis } from '../redis' |
@@ -87,7 +87,7 @@ class JobQueue { | |||
87 | }) | 87 | }) |
88 | } | 88 | } |
89 | 89 | ||
90 | async listForApi (state: JobState, start: number, count: number, sort: 'ASC' | 'DESC') { | 90 | async listForApi (state: JobState, start: number, count: number, sort: 'ASC' | 'DESC'): Promise<kue.Job[]> { |
91 | const jobStrings = await Redis.Instance.listJobs(this.jobRedisPrefix, state, 'alpha', sort, start, count) | 91 | const jobStrings = await Redis.Instance.listJobs(this.jobRedisPrefix, state, 'alpha', sort, start, count) |
92 | 92 | ||
93 | const jobPromises = jobStrings | 93 | const jobPromises = jobStrings |
@@ -149,7 +149,7 @@ class JobQueue { | |||
149 | } | 149 | } |
150 | 150 | ||
151 | private getJob (id: number) { | 151 | private getJob (id: number) { |
152 | return new Promise((res, rej) => { | 152 | return new Promise<kue.Job>((res, rej) => { |
153 | kue.Job.get(id, (err, job) => { | 153 | kue.Job.get(id, (err, job) => { |
154 | if (err) return rej(err) | 154 | if (err) return rej(err) |
155 | 155 | ||
diff --git a/server/lib/redis.ts b/server/lib/redis.ts index 2ecff939e..1fd366401 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts | |||
@@ -59,8 +59,6 @@ class Redis { | |||
59 | this.client.sort(jobsPrefix + ':jobs:' + state, 'by', mode, order, 'LIMIT', offset.toString(), count.toString(), (err, values) => { | 59 | this.client.sort(jobsPrefix + ':jobs:' + state, 'by', mode, order, 'LIMIT', offset.toString(), count.toString(), (err, values) => { |
60 | if (err) return rej(err) | 60 | if (err) return rej(err) |
61 | 61 | ||
62 | |||
63 | |||
64 | return res(values) | 62 | return res(values) |
65 | }) | 63 | }) |
66 | }) | 64 | }) |