]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Relax views federation
authorChocobozzz <me@florianbigard.com>
Mon, 20 Jun 2022 08:04:52 +0000 (10:04 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 20 Jun 2022 08:04:52 +0000 (10:04 +0200)
server/initializers/constants.ts
server/lib/views/shared/video-viewer-counters.ts

index cd2cc33d312703fd086eef6ae9218b6690b06d82..9201f95b39bb98ef09f6de8697171c68d1e986f5 100644 (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
 }
 
index 999ab7d8d7b63179a1fed332150d136291460442..5158f8f93f55e0f98480345fbaf8b1791dfd215f 100644 (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