Currently the structure is like a single parent node and multi children nodes
root: HQ (timezone: 'Asia/Seoul') children: Middle East Region (timezone: 'Asia/Riyadh'), North America Region (timezone: 'America/New_York'), ...
My program run a batch job every hour to check if any timezone requires data refinement. If the local time of that particular timezone is at 01:00 AM the batch runs to refine data in the previous day. The trigger batch job looks like the following
@Cron(CronExpression.EVERY_HOUR, { name: 'hourlyUlsRefineJob' })
async hourlyUlsRefine() {
this.logger.log('Started hourly ULS aggregation job.');
const nowUtc = dayjs.utc();
const availableTimezones = Object.values(DivisionTimezoneType);
for (const timezone of availableTimezones) {
const localTime = nowUtc.tz(timezone);
if (localTime.hour() === this.BATCH_TARGET_HOUR) {
this.logger.debug(`It's ${this.BATCH_TARGET_HOUR}:00 AM in ${timezone}. Triggering ULS batch process.`);
await this.orchestrateCusForTimezone(timezone);
}
}
this.logger.debug('Hourly ULS aggregation job check finished.');
}
Data refinement for each region is no problem, but the HQ part is where I am confused with. HQ will keep an aggregated sum of all children (i.e. Middle East Region stuffs and North America Region stuffs)
KST (Korean Standard Time) for 8/26 00:00:00 ~ 23:59:59 is translated to 8/25 15:00:00 ~ 8/26 14:59:59 in UTC.
So here comes the question:
Should the AST (Arabia Standard Time) for 8/25 00:00:00 ~ 23:59:59 which is translated to 8/25 21:00:00 ~ 8/26 20:59:59 in UTC be included in the HQ 8/26 or 8/27?
If looking at the view of HQ, it makes sense to include it in 8/27. But If thinking about the day value of 8/26 it seems like it also makes sense to include it in 8/26.
When I ask questions to AI (ChatGPT 5 and Gemini Pro 2.5) about this, they say it's more standard to include past batch to the next day. However, when I raise the issue of day value of 8/26, it starts to give me confusing answers.
I can implement it either way, but I wasn't sure what the industry standard is. If the data is aggregated in realtime, I think both ways make sense to me, but since this is a batch process which aggregates the previous day logs, I am leaning towards the "HQ PoV".