瀏覽代碼

fix: correct log message brackets in stats aggregation and rerun services

Dave 1 月之前
父節點
當前提交
7dfc6c4335

+ 3 - 3
apps/box-stats-api/src/feature/stats-events/stats-aggregation.scheduler.ts

@@ -114,7 +114,7 @@ export class StatsAggregationScheduler implements OnModuleInit {
 
     if (this.lastHourlyWindowToSec === currentHourStartSec) {
       this.logger.debug(
-        `⏰ Hourly aggregation already processed window [${currentHourStartSec - 3600},${currentHourStartSec}) this hour.`,
+        `⏰ Hourly aggregation already processed window [${currentHourStartSec - 3600},${currentHourStartSec}] this hour.`,
       );
       this.runningHourly = false;
       return;
@@ -122,7 +122,7 @@ export class StatsAggregationScheduler implements OnModuleInit {
 
     const toSec = currentHourStartSec;
     const fromSec = toSec - 3600;
-    const tag = `⏰ Hourly aggregation [${fromSec},${toSec})`;
+    const tag = `⏰ Hourly aggregation [${fromSec},${toSec}]`;
 
     this.logger.log(`${tag} start`);
 
@@ -162,7 +162,7 @@ export class StatsAggregationScheduler implements OnModuleInit {
     const nowSec = Math.floor(Date.now() / 1000);
     const yesterdayStartSec = this.floorToDayGmt8(nowSec) - 86400;
     const yesterdayEndSec = yesterdayStartSec + 86400;
-    const tag = `🗓️ Daily catch-all (GMT+8) [${yesterdayStartSec},${yesterdayEndSec})`;
+    const tag = `🗓️ Daily catch-all (GMT+8) [${yesterdayStartSec},${yesterdayEndSec}]`;
 
     if (!this.hasDailyRefresh(this.statsAggregation)) {
       this.logger.warn(

+ 2 - 2
apps/box-stats-api/src/feature/stats-events/stats-rerun.service.ts

@@ -24,7 +24,7 @@ export class StatsRerunService {
   > {
     const totalHours = (dto.toSec - dto.fromSec) / 3600;
     this.logger.log(
-      `Stats rerun requested [${dto.fromSec},${dto.toSec}) hours=${totalHours} dryRun=${dto.dryRun ?? false}`,
+      `Stats rerun requested [${dto.fromSec},${dto.toSec}] hours=${totalHours} dryRun=${dto.dryRun ?? false}`,
     );
 
     if (dto.dryRun) {
@@ -49,7 +49,7 @@ export class StatsRerunService {
     }
 
     this.logger.log(
-      `Stats rerun completed [${dto.fromSec},${dto.toSec}) hours=${totalHours}`,
+      `Stats rerun completed [${dto.fromSec},${dto.toSec}] hours=${totalHours}`,
     );
     return {
       fromSec: dto.fromSec,

+ 3 - 3
apps/box-stats-api/src/feature/stats-events/stats.hourly.aggregation.service.ts

@@ -103,7 +103,7 @@ export class StatsHourlyAggregationService {
     }
 
     this.logger.log(
-      `AdsHourly aggregation: window=[${startSec},${endSec}) buckets=${rows.length}`,
+      `AdsHourly aggregation: window=[${startSec},${endSec}] buckets=${rows.length}`,
     );
     return rows.length;
   }
@@ -211,7 +211,7 @@ export class StatsHourlyAggregationService {
     }
 
     this.logger.log(
-      `ChannelHourly aggregation: window=[${startSec},${endSec}) buckets=${rows.length}`,
+      `ChannelHourly aggregation: window=[${startSec},${endSec}] buckets=${rows.length}`,
     );
     return rows.length;
   }
@@ -227,7 +227,7 @@ export class StatsHourlyAggregationService {
     await this.aggregateChannelHourly(startSec, endSec);
 
     this.logger.log(
-      `Hourly aggregation window computed via time-helper: lookback=${lookbackHours} window=[${startSec},${endSec})`,
+      `Hourly aggregation window computed via time-helper: lookback=${lookbackHours} window=[${startSec},${endSec}]`,
     );
   }
 }