From 48cda41d69fb7b9b898ec92733eac3a381730bdf Mon Sep 17 00:00:00 2001 From: cclohmar Date: Sat, 11 Jul 2026 23:04:11 +0100 Subject: [PATCH] fix: add 1.5s delay between delete and recreate to avoid SQLITE_BUSY --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 0f5e295..8f86095 100644 --- a/main.go +++ b/main.go @@ -1616,6 +1616,9 @@ const adminHTML = ` const delResp = await fetch('/api/users/' + username, { method: 'DELETE' }); if (!delResp.ok) { alert('Failed to delete user for re-creation'); return; } + // Wait for SQLite to release the lock before recreating + await new Promise(r => setTimeout(r, 1500)); + // 2. Recreate with new data const body = JSON.stringify({ users: [{