]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/job-queue/handlers/video-views-stats.ts
/!\ Use a dedicated config file for development
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / video-views-stats.ts
index 689a5a3b4f05692743dcb0c5e83e3e8bb9383cb1..c9aa218e54a48723eead0de8c846d9df897a8837 100644 (file)
@@ -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)