Relax views federation

This commit is contained in:
Chocobozzz 2022-06-20 10:04:52 +02:00
parent da8637bac9
commit f53e1fcd99
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 2 additions and 2 deletions

View File

@ -370,7 +370,7 @@ const CONSTRAINTS_FIELDS = {
const VIEW_LIFETIME = {
VIEW: CONFIG.VIEWS.VIDEOS.IP_VIEW_EXPIRATION,
VIEWER_COUNTER: 60000 * 1, // 1 minute
VIEWER_COUNTER: 60000 * 2, // 2 minutes
VIEWER_STATS: 60000 * 60 // 1 hour
}

View File

@ -165,7 +165,7 @@ export class VideoViewerCounters {
private async federateViewerIfNeeded (video: MVideo, viewer: Viewer) {
// Federate the viewer if it's been a "long" time we did not
const now = new Date().getTime()
const federationLimit = now - (VIEW_LIFETIME.VIEWER_COUNTER / 2)
const federationLimit = now - (VIEW_LIFETIME.VIEWER_COUNTER * 0.75)
if (viewer.lastFederation && viewer.lastFederation > federationLimit) return