+ async getCachedRoute (req: express.Request) {
+ const cached = await this.getObject(this.buildCachedRouteKey(req))
+
+ return cached as CachedRoute
+ }
+
+ setCachedRoute (req: express.Request, body: any, contentType?: string, statusCode?: number) {
+ const cached: CachedRoute = {
+ body: body.toString(),
+ contentType,
+ statusCode: statusCode.toString()
+ }
+
+ return this.setObject(this.buildCachedRouteKey(req), cached, FEEDS.CACHE_LIFETIME)
+ }
+
+ 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)
+ })
+ })
+ }
+