aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-27 17:42:32 +0100
committerChocobozzz <me@florianbigard.com>2018-02-27 17:42:32 +0100
commit628d28e84ba49f4214cfe4946cbaf0a9f799929a (patch)
tree5d92bf8a153d7c3c4b7d46fae49581719b89b90e /server/lib
parentc90f0614e6edaae4939e521605a65fe186c37442 (diff)
downloadPeerTube-628d28e84ba49f4214cfe4946cbaf0a9f799929a.tar.gz
PeerTube-628d28e84ba49f4214cfe4946cbaf0a9f799929a.tar.zst
PeerTube-628d28e84ba49f4214cfe4946cbaf0a9f799929a.zip
Fix typings
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/job-queue/job-queue.ts6
-rw-r--r--server/lib/redis.ts2
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 @@
1import * as kue from 'kue' 1import * as kue from 'kue'
2import { JobType, JobState } from '../../../shared/models' 2import { JobState, JobType } from '../../../shared/models'
3import { logger } from '../../helpers/logger' 3import { logger } from '../../helpers/logger'
4import { CONFIG, JOB_ATTEMPTS, JOB_COMPLETED_LIFETIME, JOB_CONCURRENCY } from '../../initializers' 4import { CONFIG, JOB_ATTEMPTS, JOB_COMPLETED_LIFETIME, JOB_CONCURRENCY } from '../../initializers'
5import { Redis } from '../redis' 5import { 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 })