Skip to content

Commit 95e415e

Browse files
committed
comments
1 parent 59e85f7 commit 95e415e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/src/services/infrastructure/JobGenerator.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,9 @@ class JobGenerator implements IJobGenerator {
142142
};
143143
};
144144

145-
// Aggregates stats for the previous UTC hour and (at UTC midnight) the previous UTC day
146145
generateStatsAggregationJob = () => {
147146
return async () => {
148-
// Compute previous hour window in UTC
147+
// Get previous hour window in UTC
149148
const now = new Date();
150149
const utcNow = new Date(
151150
Date.UTC(
@@ -174,7 +173,7 @@ class JobGenerator implements IJobGenerator {
174173
// Upsert hourly stats for the last full hour
175174
await this.statsAggregationService.upsertHourly(hourStart, hourEnd);
176175

177-
// Roll up the current day-so-far (not finalized) so charts have partial daily data
176+
// Roll up the current day so far so we have partial data for the current day
178177
const todayStart = new Date(
179178
Date.UTC(
180179
now.getUTCFullYear(),
@@ -188,7 +187,7 @@ class JobGenerator implements IJobGenerator {
188187
);
189188
await this.statsAggregationService.rollupDaily(todayStart, utcNow, false);
190189

191-
// If at UTC midnight hour (i.e., hour just rolled over), finalize the previous day
190+
// If at UTC midnight hour finalize the previous day
192191
const hour = utcNow.getUTCHours();
193192
if (hour === 0) {
194193
const dayEnd = todayStart; // just reached 00:00, previous day ends now

0 commit comments

Comments
 (0)