aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-20 10:04:52 +0200
committerChocobozzz <me@florianbigard.com>2022-06-20 10:04:52 +0200
commitf53e1fcd990e790a196ad39044a3520e605978c6 (patch)
treeefe0655d7b7f9c2020e62202b06d2543727158d7
parentda8637bac9e32b21df2389d7698ce91070ec3a39 (diff)
downloadPeerTube-f53e1fcd990e790a196ad39044a3520e605978c6.tar.gz
PeerTube-f53e1fcd990e790a196ad39044a3520e605978c6.tar.zst
PeerTube-f53e1fcd990e790a196ad39044a3520e605978c6.zip
Relax views federation
-rw-r--r--server/initializers/constants.ts2
-rw-r--r--server/lib/views/shared/video-viewer-counters.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index cd2cc33d3..9201f95b3 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -370,7 +370,7 @@ const CONSTRAINTS_FIELDS = {
370 370
371const VIEW_LIFETIME = { 371const VIEW_LIFETIME = {
372 VIEW: CONFIG.VIEWS.VIDEOS.IP_VIEW_EXPIRATION, 372 VIEW: CONFIG.VIEWS.VIDEOS.IP_VIEW_EXPIRATION,
373 VIEWER_COUNTER: 60000 * 1, // 1 minute 373 VIEWER_COUNTER: 60000 * 2, // 2 minutes
374 VIEWER_STATS: 60000 * 60 // 1 hour 374 VIEWER_STATS: 60000 * 60 // 1 hour
375} 375}
376 376
diff --git a/server/lib/views/shared/video-viewer-counters.ts b/server/lib/views/shared/video-viewer-counters.ts
index 999ab7d8d..5158f8f93 100644
--- a/server/lib/views/shared/video-viewer-counters.ts
+++ b/server/lib/views/shared/video-viewer-counters.ts
@@ -165,7 +165,7 @@ export class VideoViewerCounters {
165 private async federateViewerIfNeeded (video: MVideo, viewer: Viewer) { 165 private async federateViewerIfNeeded (video: MVideo, viewer: Viewer) {
166 // Federate the viewer if it's been a "long" time we did not 166 // Federate the viewer if it's been a "long" time we did not
167 const now = new Date().getTime() 167 const now = new Date().getTime()
168 const federationLimit = now - (VIEW_LIFETIME.VIEWER_COUNTER / 2) 168 const federationLimit = now - (VIEW_LIFETIME.VIEWER_COUNTER * 0.75)
169 169
170 if (viewer.lastFederation && viewer.lastFederation > federationLimit) return 170 if (viewer.lastFederation && viewer.lastFederation > federationLimit) return
171 171