mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Add ability to limit videos history size
This commit is contained in:
parent
76062d9f96
commit
8f0bc73d7d
14 changed files with 116 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
import * as express from 'express'
|
||||
import * as AsyncLock from 'async-lock'
|
||||
import { parseDuration } from '../helpers/core-utils'
|
||||
import { parseDurationToMs } from '../helpers/core-utils'
|
||||
import { Redis } from '../lib/redis'
|
||||
import { logger } from '../helpers/logger'
|
||||
|
||||
|
@ -24,7 +24,7 @@ function cacheRoute (lifetimeArg: string | number) {
|
|||
res.send = (body) => {
|
||||
if (res.statusCode >= 200 && res.statusCode < 400) {
|
||||
const contentType = res.get('content-type')
|
||||
const lifetime = parseDuration(lifetimeArg)
|
||||
const lifetime = parseDurationToMs(lifetimeArg)
|
||||
|
||||
Redis.Instance.setCachedRoute(req, body, lifetime, contentType, res.statusCode)
|
||||
.then(() => done())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue