diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-27 16:57:53 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-27 16:57:53 +0100 |
commit | 2c29ad4f3b736912ae769a288c4795dce40e388d (patch) | |
tree | a74312c17b693159f682e3331210a65372571e6a /server/lib/redis.ts | |
parent | 056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1 (diff) | |
download | PeerTube-2c29ad4f3b736912ae769a288c4795dce40e388d.tar.gz PeerTube-2c29ad4f3b736912ae769a288c4795dce40e388d.tar.zst PeerTube-2c29ad4f3b736912ae769a288c4795dce40e388d.zip |
Fix job panel sorting in administration
Diffstat (limited to 'server/lib/redis.ts')
-rw-r--r-- | server/lib/redis.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/lib/redis.ts b/server/lib/redis.ts index b284cab8f..2ecff939e 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts | |||
@@ -54,6 +54,18 @@ class Redis { | |||
54 | return this.exists(this.buildViewKey(ip, videoUUID)) | 54 | return this.exists(this.buildViewKey(ip, videoUUID)) |
55 | } | 55 | } |
56 | 56 | ||
57 | listJobs (jobsPrefix: string, state: string, mode: 'alpha', order: 'ASC' | 'DESC', offset: number, count: number) { | ||
58 | return new Promise<string[]>((res, rej) => { | ||
59 | this.client.sort(jobsPrefix + ':jobs:' + state, 'by', mode, order, 'LIMIT', offset.toString(), count.toString(), (err, values) => { | ||
60 | if (err) return rej(err) | ||
61 | |||
62 | |||
63 | |||
64 | return res(values) | ||
65 | }) | ||
66 | }) | ||
67 | } | ||
68 | |||
57 | private getValue (key: string) { | 69 | private getValue (key: string) { |
58 | return new Promise<string>((res, rej) => { | 70 | return new Promise<string>((res, rej) => { |
59 | this.client.get(this.prefix + key, (err, value) => { | 71 | this.client.get(this.prefix + key, (err, value) => { |