mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
fix(analytics): set wait_for_async_insert=1 and log ClickHouse insert result
This commit is contained in:
@@ -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())}`,
|
||||
|
||||
Reference in New Issue
Block a user