Commit 943c7d44 by luoqi

fix(sync): 增量/stale-scan cron 补 timeZone=Asia/Shanghai

容器时区为 UTC,而 @Cron 未指定 timeZone → cron 表达式按 UTC 解释,
导致"凌晨"任务实际 +8h:增量 03:30→11:30、stale-scan 02:00→10:00。
两处补 timeZone: 'Asia/Shanghai'(coverage-monitor 早已正确指定,对齐之)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
parent 800d7775
......@@ -37,6 +37,8 @@ export class StaleScanService {
*/
@Cron(process.env.PAC_STALE_SCAN_CRON || '0 0 31 12 *' /* never — env not set */, {
name: 'persona-stale-scan',
// cron 表达式按北京时间解释(容器为 UTC;不加则实际 +8h)
timeZone: 'Asia/Shanghai',
})
async scanAndEnqueueStale(): Promise<void> {
const startedAt = Date.now();
......
......@@ -48,6 +48,8 @@ export class SyncIncrementalSchedulerService {
/// 详见 .env.example
@Cron(process.env.PAC_INCREMENTAL_CRON || '0 0 31 12 *' /* never — env not set */, {
name: 'sync-incremental-daily',
// cron 表达式按北京时间解释(容器为 UTC;不加则实际 +8h —— 03:30 会变 11:30)
timeZone: 'Asia/Shanghai',
})
async runDaily(): Promise<void> {
const dataDir = process.env.PAC_INCREMENTAL_DATA_DIR ?? path.resolve(__dirname, '../../data');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment