mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
fix: high cpu from status probes and full database saves on every sample (#1300)
This commit is contained in:
1 parent
11a22d30eb
commit
79bd10a1b0
10 files changed
+241
-22
No files matched your search
@@ -528,7 +528,7 @@ export async function createAutomationRepository(
|
||||
.set({ lastRunAt: run[0].startedAt, lastRunStatus: input.status })
|
||||
.where(eq(automations.id, run[0].automationId));
|
||||
}
|
||||
await db.persist();
|
||||
await db.persist({ lazy: true });
|
||||
},
|
||||
|
||||
async listRuns(
|
||||
@@ -630,7 +630,7 @@ export async function createAutomationRepository(
|
||||
.where(lt(runs.startedAt, cutoff));
|
||||
if (old.length === 0) return 0;
|
||||
await drizzle.delete(runs).where(lt(runs.startedAt, cutoff));
|
||||
await db.persist();
|
||||
await db.persist({ lazy: true });
|
||||
return old.length;
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user