chore: ensure config is loaded before init functions (#226)

This commit is contained in:
Aveline
2025-03-04 11:32:54 +01:00
committed by GitHub
parent d4efd72731
commit 554121a20b
5 changed files with 16 additions and 0 deletions

4
usb.go
View File

@@ -34,6 +34,8 @@ func mountConfigFS() error {
}
func init() {
ensureConfigLoaded()
_ = os.MkdirAll(imagesFolder, 0755)
udcs := gadget.GetUdcs()
if len(udcs) < 1 {
@@ -383,6 +385,8 @@ func triggerUSBStateUpdate() {
var udc string
func init() {
ensureConfigLoaded()
go func() {
for {
newState := rpcGetUSBState()