aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/cache.ts4
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 @@
1import * as express from 'express' 1import * as express from 'express'
2import * as AsyncLock from 'async-lock' 2import * as AsyncLock from 'async-lock'
3import { parseDuration } from '../helpers/core-utils' 3import { parseDurationToMs } from '../helpers/core-utils'
4import { Redis } from '../lib/redis' 4import { Redis } from '../lib/redis'
5import { logger } from '../helpers/logger' 5import { 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())