diff options
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/cache.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/middlewares/cache.ts b/server/middlewares/cache.ts index 8ffe75700..e83d8d569 100644 --- a/server/middlewares/cache.ts +++ b/server/middlewares/cache.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import * as AsyncLock from 'async-lock' | 2 | import * as AsyncLock from 'async-lock' |
3 | import { parseDuration } from '../helpers/core-utils' | 3 | import { parseDurationToMs } from '../helpers/core-utils' |
4 | import { Redis } from '../lib/redis' | 4 | import { Redis } from '../lib/redis' |
5 | import { logger } from '../helpers/logger' | 5 | import { logger } from '../helpers/logger' |
6 | 6 | ||
@@ -24,7 +24,7 @@ function cacheRoute (lifetimeArg: string | number) { | |||
24 | res.send = (body) => { | 24 | res.send = (body) => { |
25 | if (res.statusCode >= 200 && res.statusCode < 400) { | 25 | if (res.statusCode >= 200 && res.statusCode < 400) { |
26 | const contentType = res.get('content-type') | 26 | const contentType = res.get('content-type') |
27 | const lifetime = parseDuration(lifetimeArg) | 27 | const lifetime = parseDurationToMs(lifetimeArg) |
28 | 28 | ||
29 | Redis.Instance.setCachedRoute(req, body, lifetime, contentType, res.statusCode) | 29 | Redis.Instance.setCachedRoute(req, body, lifetime, contentType, res.statusCode) |
30 | .then(() => done()) | 30 | .then(() => done()) |