mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-11-26 14:48:31 +01:00
Never block the task loop on scheduled WS bring-up; sqlite busy timeout
taskStartWs() (a full './ws -b': render + docker compose up --build) ran synchronously inside the tick-1 schedule, before GetNextTask() could run. When the VM's docker daemon is slow or wedged, edgeboxctl stays blocked for hours or days and dashboard tasks (e.g. enable_ssh_access) sit in the queue unprocessed. - run the scheduled WS bring-up in a goroutine; the task loop no longer waits for it - add a busy timeout to the shared sqlite connection string so edgeboxctl waits for the API's write locks instead of erroring
This commit is contained in:
@@ -91,7 +91,10 @@ func GetSQLiteDbConnectionDetails() string {
|
||||
log.Fatal("Error loading .env file")
|
||||
}
|
||||
|
||||
return apiEnv["SQLITE_DATABASE"] // Will read from api project edgebox.env file
|
||||
// The API (running in its own container) writes to this same database.
|
||||
// A busy timeout lets edgeboxctl wait for the lock instead of failing
|
||||
// instantly when the API is mid-write.
|
||||
return apiEnv["SQLITE_DATABASE"] + "?_busy_timeout=5000" // Will read from api project edgebox.env file
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user