fix: high cpu from status probes and full database saves on every sample (#1300)

This commit is contained in:
LukeGus committed 2026-10-03 15:37:11 -05:00
1 parent 11a22d30eb
commit 79bd10a1b0
10 files changed
+241 -22

No files matched your search

+2 -2
View File
@@ -304,7 +304,7 @@ export async function createAlertsRepository(
dedupeKey: item.dedupeKey ?? null,
createdAt,
});
await db.persist();
await db.persist({ lazy: true });
return toItem({
id,
...item,
@@ -322,7 +322,7 @@ export async function createAlertsRepository(
.update(items)
.set({ deliveries: JSON.stringify(results) })
.where(eq(items.id, id));
await db.persist();
await db.persist({ lazy: true });
},
async hasUnreadWithKey(userId: string, key: string): Promise<boolean> {