From 9452d4fd3321148fb80b64a67bd9983fee6c208e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 Jul 2022 15:44:14 +0200 Subject: /!\ Use a dedicated config file for development It means you have to replace NODE_ENV=test to NODE_ENV=dev if you use it npm run dev:* commands are already updated --- server/lib/job-queue/handlers/video-views-stats.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/lib/job-queue/handlers/video-views-stats.ts') diff --git a/server/lib/job-queue/handlers/video-views-stats.ts b/server/lib/job-queue/handlers/video-views-stats.ts index 689a5a3b4..c9aa218e5 100644 --- a/server/lib/job-queue/handlers/video-views-stats.ts +++ b/server/lib/job-queue/handlers/video-views-stats.ts @@ -1,5 +1,5 @@ import { VideoViewModel } from '@server/models/view/video-view' -import { isTestInstance } from '../../../helpers/core-utils' +import { isTestOrDevInstance } from '../../../helpers/core-utils' import { logger } from '../../../helpers/logger' import { VideoModel } from '../../../models/video/video' import { Redis } from '../../redis' @@ -8,7 +8,7 @@ async function processVideosViewsStats () { const lastHour = new Date() // In test mode, we run this function multiple times per hour, so we don't want the values of the previous hour - if (!isTestInstance()) lastHour.setHours(lastHour.getHours() - 1) + if (!isTestOrDevInstance()) lastHour.setHours(lastHour.getHours() - 1) const hour = lastHour.getHours() const startDate = lastHour.setMinutes(0, 0, 0) -- cgit v1.2.3