fix(mining-blockchain-service): 双保险过滤 2026-03-10 前的 AdoptionFusdtInjectionRequested 事件
防止 outbox connector 宕机期间积压的历史消息在恢复后触发意外的 fUSDT 注入。 只处理 created_at >= 2026-03-10T00:00:00+08:00 的事件,早于截止日期的事件直接丢弃并记录警告日志。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e4a2690130
commit
7aa7a54d9c
|
|
@ -139,6 +139,16 @@ export class AdoptionInjectionConsumerService implements OnModuleInit, OnModuleD
|
|||
return;
|
||||
}
|
||||
|
||||
// 双保险:丢弃 2026-03-10 前的事件,防止历史积压消息触发意外注入
|
||||
const CUTOFF_DATE = new Date('2026-03-10T00:00:00+08:00');
|
||||
const eventCreatedAt = parsed.created_at ? new Date(parsed.created_at) : null;
|
||||
if (!eventCreatedAt || eventCreatedAt < CUTOFF_DATE) {
|
||||
this.logger.warn(
|
||||
`[SKIP] AdoptionFusdtInjectionRequested event discarded: created_at=${parsed.created_at} is before cutoff ${CUTOFF_DATE.toISOString()}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.log(`[RECEIVE] AdoptionFusdtInjectionRequested event received`);
|
||||
this.logger.log(`[RECEIVE] offset=${message.offset}, partition=${partition}`);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue