Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Disable wait_for_async_insert for now

Fang-Pen Lin003099c4003b
diff --git a/backend/src/lib/config/env.ts b/backend/src/lib/config/env.ts
index ce6d6fbacd..7fdfa58f04 100644
--- a/backend/src/lib/config/env.ts
+++ b/backend/src/lib/config/env.ts
@@ -99,7 +99,15 @@ const envSchema = z
if (!val || val.trim() === "")
return {
async_insert: 1,
- wait_for_async_insert: 1,
+ // !!!NOTICE!!! by disabling wait_for_async_insert, we shouldn't suffer from the audit log queue piles up jobs
+ // issues anymore as now insert won't be blocked until the data is written to disk.
+ // However, this works at the cost of DATA LOSS if the ClickHouse server crashes
+ // before the data is written to disk.
+ // Because our Redis queue if without AOF + Fsync, may already suffer data loss issues,
+ // so it's not worsening the issue at least for now.
+ // Let's have this rolled out in production and see how things go for now,
+ // in the meantime, we should think about a better solution to handle this.
+ wait_for_async_insert: 0,
date_time_input_format: "best_effort"
} as Record<string, string | number | boolean>;
return JSON.parse(val) as Record<string, string | number | boolean>;