aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/cache.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-11 15:38:53 +0200
committerChocobozzz <me@florianbigard.com>2019-04-11 15:38:53 +0200
commit8f0bc73d7d5f4c88cbc5588a0ece12b3855c8f98 (patch)
treee04f1da52f9377cf6ce820425c0de6e57ab57fc6 /server/middlewares/cache.ts
parent76062d9f96e06a23a2efc8a727ea9c5394d21466 (diff)
downloadPeerTube-8f0bc73d7d5f4c88cbc5588a0ece12b3855c8f98.tar.gz
PeerTube-8f0bc73d7d5f4c88cbc5588a0ece12b3855c8f98.tar.zst
PeerTube-8f0bc73d7d5f4c88cbc5588a0ece12b3855c8f98.zip
Add ability to limit videos history size
Diffstat (limited to 'server/middlewares/cache.ts')
-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())