aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/video-views.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-30 11:53:38 +0100
committerChocobozzz <me@florianbigard.com>2020-01-30 11:53:38 +0100
commitca6d36227a9273f616a462d3aad6a721ab5dd627 (patch)
treea1610578e719ddb2c58199f06dd4eae436d25c0a /server/lib/job-queue/handlers/video-views.ts
parent215304eaa06020f27152108567c6a9de16b220d3 (diff)
downloadPeerTube-ca6d36227a9273f616a462d3aad6a721ab5dd627.tar.gz
PeerTube-ca6d36227a9273f616a462d3aad6a721ab5dd627.tar.zst
PeerTube-ca6d36227a9273f616a462d3aad6a721ab5dd627.zip
Add url field in caption and use it for thumbnails
Diffstat (limited to 'server/lib/job-queue/handlers/video-views.ts')
-rw-r--r--server/lib/job-queue/handlers/video-views.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/job-queue/handlers/video-views.ts b/server/lib/job-queue/handlers/video-views.ts
index 73fa5ed04..2258cd029 100644
--- a/server/lib/job-queue/handlers/video-views.ts
+++ b/server/lib/job-queue/handlers/video-views.ts
@@ -23,6 +23,8 @@ async function processVideosViews () {
23 for (const videoId of videoIds) { 23 for (const videoId of videoIds) {
24 try { 24 try {
25 const views = await Redis.Instance.getVideoViews(videoId, hour) 25 const views = await Redis.Instance.getVideoViews(videoId, hour)
26 await Redis.Instance.deleteVideoViews(videoId, hour)
27
26 if (views) { 28 if (views) {
27 logger.debug('Adding %d views to video %d in hour %d.', views, videoId, hour) 29 logger.debug('Adding %d views to video %d in hour %d.', views, videoId, hour)
28 30
@@ -52,8 +54,6 @@ async function processVideosViews () {
52 logger.error('Cannot create video views for video %d in hour %d.', videoId, hour, { err }) 54 logger.error('Cannot create video views for video %d in hour %d.', videoId, hour, { err })
53 } 55 }
54 } 56 }
55
56 await Redis.Instance.deleteVideoViews(videoId, hour)
57 } catch (err) { 57 } catch (err) {
58 logger.error('Cannot update video views of video %d in hour %d.', videoId, hour, { err }) 58 logger.error('Cannot update video views of video %d in hour %d.', videoId, hour, { err })
59 } 59 }