From ca6d36227a9273f616a462d3aad6a721ab5dd627 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Jan 2020 11:53:38 +0100 Subject: Add url field in caption and use it for thumbnails --- server/lib/job-queue/handlers/video-views.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/lib/job-queue/handlers/video-views.ts') 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 () { for (const videoId of videoIds) { try { const views = await Redis.Instance.getVideoViews(videoId, hour) + await Redis.Instance.deleteVideoViews(videoId, hour) + if (views) { logger.debug('Adding %d views to video %d in hour %d.', views, videoId, hour) @@ -52,8 +54,6 @@ async function processVideosViews () { logger.error('Cannot create video views for video %d in hour %d.', videoId, hour, { err }) } } - - await Redis.Instance.deleteVideoViews(videoId, hour) } catch (err) { logger.error('Cannot update video views of video %d in hour %d.', videoId, hour, { err }) } -- cgit v1.2.3