feat: 添加 G5 状态表 IP 同步功能,新增 upsert 方法并更新相关测试
This commit is contained in:
@@ -183,6 +183,9 @@ const bootstrap = async () => {
|
||||
promises.push(g5DbManager.insertRows({ schema: config.g5db.schema, table: config.g5db.table, rows }).catch(e => {
|
||||
logger.error('G5 Database insert failed but non-blocking', { error: e.message });
|
||||
}));
|
||||
promises.push(g5DbManager.upsertRoomStatusMomentIp(rows).catch(e => {
|
||||
logger.error('G5 room_status_moment_g5 upsert failed but non-blocking', { error: e.message });
|
||||
}));
|
||||
}
|
||||
await Promise.all(promises);
|
||||
|
||||
@@ -213,6 +216,9 @@ const bootstrap = async () => {
|
||||
promises.push(g5DbManager.insertRows({ schema: config.g5db.schema, table: config.g5db.table, rows }).catch(e => {
|
||||
logger.error('G5 Database insert failed in insertOnce', { error: e.message });
|
||||
}));
|
||||
promises.push(g5DbManager.upsertRoomStatusMomentIp(rows).catch(e => {
|
||||
logger.error('G5 room_status_moment_g5 upsert failed in insertOnce', { error: e.message });
|
||||
}));
|
||||
}
|
||||
await Promise.all(promises);
|
||||
metricCollector.increment('db_insert_count', 1);
|
||||
|
||||
Reference in New Issue
Block a user