mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 09:49:20 +02:00
Optimize views endpoint
Lazy write data in redis
This commit is contained in:
parent
eba9528391
commit
dbdc20e673
3 changed files with 54 additions and 3 deletions
|
@ -480,6 +480,7 @@ const VIEW_LIFETIME = {
|
|||
VIEWER_COUNTER: 60000 * 2, // 2 minutes
|
||||
VIEWER_STATS: 60000 * 60 // 1 hour
|
||||
}
|
||||
let VIEWER_SYNC_REDIS = 30000 // Sync viewer into redis
|
||||
|
||||
const MAX_LOCAL_VIEWER_WATCH_SECTIONS = 100
|
||||
|
||||
|
@ -1102,6 +1103,8 @@ if (process.env.PRODUCTION_CONSTANTS !== 'true') {
|
|||
PLUGIN_EXTERNAL_AUTH_TOKEN_LIFETIME = 5000
|
||||
|
||||
JOB_REMOVAL_OPTIONS.SUCCESS['videos-views-stats'] = 10000
|
||||
|
||||
VIEWER_SYNC_REDIS = 1000
|
||||
}
|
||||
|
||||
if (isTestInstance()) {
|
||||
|
@ -1202,6 +1205,7 @@ export {
|
|||
DEFAULT_THEME_NAME,
|
||||
NSFW_POLICY_TYPES,
|
||||
STATIC_MAX_AGE,
|
||||
VIEWER_SYNC_REDIS,
|
||||
STATIC_PATHS,
|
||||
VIDEO_IMPORT_TIMEOUT,
|
||||
VIDEO_PLAYLIST_TYPES,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue