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/views/shared/video-viewer-counters.ts | 4 ++-- server/lib/views/shared/video-viewer-stats.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server/lib/views') diff --git a/server/lib/views/shared/video-viewer-counters.ts b/server/lib/views/shared/video-viewer-counters.ts index cf3fa5882..f851ce050 100644 --- a/server/lib/views/shared/video-viewer-counters.ts +++ b/server/lib/views/shared/video-viewer-counters.ts @@ -1,4 +1,4 @@ -import { isTestInstance } from '@server/helpers/core-utils' +import { isTestOrDevInstance } from '@server/helpers/core-utils' import { logger, loggerTagsFactory } from '@server/helpers/logger' import { VIEW_LIFETIME } from '@server/initializers/constants' import { sendView } from '@server/lib/activitypub/send/send-view' @@ -117,7 +117,7 @@ export class VideoViewerCounters { if (this.processingViewerCounters) return this.processingViewerCounters = true - if (!isTestInstance()) logger.info('Cleaning video viewers.', lTags()) + if (!isTestOrDevInstance()) logger.info('Cleaning video viewers.', lTags()) try { for (const videoId of this.viewersPerVideo.keys()) { diff --git a/server/lib/views/shared/video-viewer-stats.ts b/server/lib/views/shared/video-viewer-stats.ts index a56c20559..542bd51cf 100644 --- a/server/lib/views/shared/video-viewer-stats.ts +++ b/server/lib/views/shared/video-viewer-stats.ts @@ -1,5 +1,5 @@ import { Transaction } from 'sequelize/types' -import { isTestInstance } from '@server/helpers/core-utils' +import { isTestOrDevInstance } from '@server/helpers/core-utils' import { GeoIP } from '@server/helpers/geo-ip' import { logger, loggerTagsFactory } from '@server/helpers/logger' import { MAX_LOCAL_VIEWER_WATCH_SECTIONS, VIEW_LIFETIME } from '@server/initializers/constants' @@ -118,7 +118,7 @@ export class VideoViewerStats { if (this.processingViewersStats) return this.processingViewersStats = true - if (!isTestInstance()) logger.info('Processing viewer statistics.', lTags()) + if (!isTestOrDevInstance()) logger.info('Processing viewer statistics.', lTags()) const now = new Date().getTime() -- cgit v1.2.3