aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-09 10:11:20 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-11-09 15:00:31 +0100
commit51353d9a035fb6b81f903a8b5f391292841649fd (patch)
tree75acb6eea5e043bf2e15a6a5a92e9a3c5967b156 /server.ts
parent221ee1adc916684d4881d2a9c4c01954dcde986e (diff)
downloadPeerTube-51353d9a035fb6b81f903a8b5f391292841649fd.tar.gz
PeerTube-51353d9a035fb6b81f903a8b5f391292841649fd.tar.zst
PeerTube-51353d9a035fb6b81f903a8b5f391292841649fd.zip
Refactor video views
Introduce viewers attribute for live videos Count views for live videos Reduce delay to see the viewer update for lives Add ability to configure video views buffer interval and view ip expiration
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server.ts b/server.ts
index b8c1d1251..6a7dad0cd 100644
--- a/server.ts
+++ b/server.ts
@@ -117,6 +117,7 @@ import { VideosRedundancyScheduler } from './server/lib/schedulers/videos-redund
117import { RemoveOldHistoryScheduler } from './server/lib/schedulers/remove-old-history-scheduler' 117import { RemoveOldHistoryScheduler } from './server/lib/schedulers/remove-old-history-scheduler'
118import { AutoFollowIndexInstances } from './server/lib/schedulers/auto-follow-index-instances' 118import { AutoFollowIndexInstances } from './server/lib/schedulers/auto-follow-index-instances'
119import { RemoveDanglingResumableUploadsScheduler } from './server/lib/schedulers/remove-dangling-resumable-uploads-scheduler' 119import { RemoveDanglingResumableUploadsScheduler } from './server/lib/schedulers/remove-dangling-resumable-uploads-scheduler'
120import { VideoViewsBufferScheduler } from './server/lib/schedulers/video-views-buffer-scheduler'
120import { isHTTPSignatureDigestValid } from './server/helpers/peertube-crypto' 121import { isHTTPSignatureDigestValid } from './server/helpers/peertube-crypto'
121import { PeerTubeSocket } from './server/lib/peertube-socket' 122import { PeerTubeSocket } from './server/lib/peertube-socket'
122import { updateStreamingPlaylistsInfohashesIfNeeded } from './server/lib/hls' 123import { updateStreamingPlaylistsInfohashesIfNeeded } from './server/lib/hls'
@@ -128,6 +129,7 @@ import { LiveManager } from './server/lib/live'
128import { HttpStatusCode } from './shared/models/http/http-error-codes' 129import { HttpStatusCode } from './shared/models/http/http-error-codes'
129import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' 130import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache'
130import { ServerConfigManager } from '@server/lib/server-config-manager' 131import { ServerConfigManager } from '@server/lib/server-config-manager'
132import { VideoViews } from '@server/lib/video-views'
131 133
132// ----------- Command line ----------- 134// ----------- Command line -----------
133 135
@@ -296,11 +298,11 @@ async function startApplication () {
296 PeerTubeVersionCheckScheduler.Instance.enable() 298 PeerTubeVersionCheckScheduler.Instance.enable()
297 AutoFollowIndexInstances.Instance.enable() 299 AutoFollowIndexInstances.Instance.enable()
298 RemoveDanglingResumableUploadsScheduler.Instance.enable() 300 RemoveDanglingResumableUploadsScheduler.Instance.enable()
301 VideoViewsBufferScheduler.Instance.enable()
299 302
300 // Redis initialization
301 Redis.Instance.init() 303 Redis.Instance.init()
302
303 PeerTubeSocket.Instance.init(server) 304 PeerTubeSocket.Instance.init(server)
305 VideoViews.Instance.init()
304 306
305 updateStreamingPlaylistsInfohashesIfNeeded() 307 updateStreamingPlaylistsInfohashesIfNeeded()
306 .catch(err => logger.error('Cannot update streaming playlist infohashes.', { err })) 308 .catch(err => logger.error('Cannot update streaming playlist infohashes.', { err }))