1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Fix job panel sorting in administration

This commit is contained in:
Chocobozzz 2018-02-27 16:57:53 +01:00
parent 056aa7f2b4
commit 2c29ad4f3b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 35 additions and 9 deletions

View file

@ -54,6 +54,18 @@ class Redis {
return this.exists(this.buildViewKey(ip, videoUUID))
}
listJobs (jobsPrefix: string, state: string, mode: 'alpha', order: 'ASC' | 'DESC', offset: number, count: number) {
return new Promise<string[]>((res, rej) => {
this.client.sort(jobsPrefix + ':jobs:' + state, 'by', mode, order, 'LIMIT', offset.toString(), count.toString(), (err, values) => {
if (err) return rej(err)
return res(values)
})
})
}
private getValue (key: string) {
return new Promise<string>((res, rej) => {
this.client.get(this.prefix + key, (err, value) => {