mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
chore: ensure config is loaded before init functions (#226)
This commit is contained in:
4
usb.go
4
usb.go
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user