mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-11-26 14:48:31 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b39524ab8a | ||
|
|
3717c6e90b | ||
|
|
b1cbb90fc2 |
@@ -3,6 +3,7 @@
|
|||||||
package storage
|
package storage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -26,10 +27,10 @@ func assertGetDevices(devices []Device, t *testing.T) {
|
|||||||
|
|
||||||
foundDevice := false
|
foundDevice := false
|
||||||
|
|
||||||
t.Log("Looking for a mmcblk0, sda or dva device")
|
t.Log("Looking for a mmcblk0, sda, vda or nvme device")
|
||||||
for _, device := range devices {
|
for _, device := range devices {
|
||||||
|
|
||||||
if device.ID == "mmcblk0" || device.ID == "sda" || device.ID == "vda" {
|
if device.ID == "mmcblk0" || device.ID == "sda" || device.ID == "vda" || strings.HasPrefix(string(device.ID), "nvme") {
|
||||||
t.Log("Found target device", device.ID)
|
t.Log("Found target device", device.ID)
|
||||||
foundDevice = true
|
foundDevice = true
|
||||||
}
|
}
|
||||||
@@ -37,7 +38,7 @@ func assertGetDevices(devices []Device, t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !foundDevice {
|
if !foundDevice {
|
||||||
t.Log("Expected to find device mmcblk0, sda or dva but did not. Devices:", devices)
|
t.Log("Expected to find device mmcblk0, sda, vda or nvme but did not. Devices:", devices)
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ func UpdateSystemLoggerServices(services []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// StartWs: Starts the webserver service for Edgeapps
|
// StartWs: Starts the webserver service for Edgeapps
|
||||||
|
// StartWs : Starts the WS environment (renders and brings up all modules)
|
||||||
func StartWs() {
|
func StartWs() {
|
||||||
wsPath := utils.GetPath(utils.WsPath)
|
wsPath := utils.GetPath(utils.WsPath)
|
||||||
fmt.Println("Starting WS")
|
fmt.Println("Starting WS")
|
||||||
|
|||||||
@@ -588,8 +588,13 @@ func ExecuteSchedules(tick int) {
|
|||||||
uptime := taskGetSystemUptime()
|
uptime := taskGetSystemUptime()
|
||||||
log.Println("Uptime is " + uptime + " seconds (" + system.GetUptimeFormatted() + ")")
|
log.Println("Uptime is " + uptime + " seconds (" + system.GetUptimeFormatted() + ")")
|
||||||
|
|
||||||
log.Println(taskGetStorageDevices())
|
// Run the WS bring-up asynchronously: a full "./ws -b" can take a
|
||||||
taskStartWs()
|
// long time (image builds, busy docker daemon) and must never block
|
||||||
|
// the task loop from fetching queued dashboard tasks.
|
||||||
|
go func() {
|
||||||
|
taskStartWs()
|
||||||
|
log.Println("WS start finished (async)")
|
||||||
|
}()
|
||||||
log.Println(taskGetEdgeApps())
|
log.Println(taskGetEdgeApps())
|
||||||
taskUpdateSystemLoggerServices()
|
taskUpdateSystemLoggerServices()
|
||||||
taskRecoverFromUpdate()
|
taskRecoverFromUpdate()
|
||||||
|
|||||||
@@ -91,7 +91,10 @@ func GetSQLiteDbConnectionDetails() string {
|
|||||||
log.Fatal("Error loading .env file")
|
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