fix: add 1.5s delay between delete and recreate to avoid SQLITE_BUSY
This commit is contained in:
parent
6cf084b931
commit
48cda41d69
1 changed files with 3 additions and 0 deletions
3
main.go
3
main.go
|
|
@ -1616,6 +1616,9 @@ const adminHTML = `<!DOCTYPE html>
|
|||
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: [{
|
||||
|
|
|
|||
Loading…
Reference in a new issue