From 91cafb49f984b8215971c1b14facd93365a9ea60 Mon Sep 17 00:00:00 2001 From: SaelixCode Date: Fri, 27 Feb 2026 11:10:35 -0500 Subject: [PATCH] refactor: update journal mode comment for DatabaseService and optimize CPU state check in EditorLayout --- backend/src/services/DatabaseService.ts | 3 +-- frontend/src/components/EditorLayout.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/src/services/DatabaseService.ts b/backend/src/services/DatabaseService.ts index e6f6fc99..4208069a 100644 --- a/backend/src/services/DatabaseService.ts +++ b/backend/src/services/DatabaseService.ts @@ -47,8 +47,7 @@ export class DatabaseService { const dbPath = path.join(dataDir, 'sencho.db'); this.db = new Database(dbPath); - // Use WAL mode for better concurrency performance - this.db.pragma('journal_mode = WAL'); + // Default journal mode is safer for arbitrary Docker volume mounts than WAL this.initSchema(); } diff --git a/frontend/src/components/EditorLayout.tsx b/frontend/src/components/EditorLayout.tsx index d204ae4c..33a8ea29 100644 --- a/frontend/src/components/EditorLayout.tsx +++ b/frontend/src/components/EditorLayout.tsx @@ -197,10 +197,16 @@ export default function EditorLayout() { const netIO = `${formatBytes(rxRate)}/s ↓ / ${formatBytes(txRate)}/s ↑`; + // Check if values actually changed to prevent infinite re-renders + const newCpu = cpuPercent + '%'; + if (prevStat && prevStat.cpu === newCpu && prevStat.ram === ramUsage && prevStat.lastRx === currentRx && prevStat.lastTx === currentTx) { + return prev; + } + return { ...prev, [container.Id]: { - cpu: cpuPercent + '%', + cpu: newCpu, ram: ramUsage, net: netIO, lastRx: currentRx,