fix(analytics): set wait_for_async_insert=1 and log ClickHouse insert result

This commit is contained in:
Nawaz Dhandala
2025-10-27 15:19:58 +00:00
parent d84039e621
commit 9d93d59f91

View File

@@ -109,15 +109,19 @@ export default class AnalyticsDatabaseService<
}
try {
await client.insert({
const result = await client.insert({
table: tableName,
values: rows,
format: "JSONEachRow",
clickhouse_settings: {
async_insert: 1,
wait_for_async_insert: 0,
wait_for_async_insert: 1,
},
});
logger.debug(`ClickHouse insert succeeded for table ${tableName} at ${OneUptimeDate.toString(OneUptimeDate.getCurrentDate())}`);
logger.debug(result);
} catch (error) {
logger.error(
`ClickHouse insert failed for table ${tableName} at ${OneUptimeDate.toString(OneUptimeDate.getCurrentDate())}`,