File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ func handleCloudRegister(c *gin.Context) {
68
68
return
69
69
}
70
70
71
+ if config .CloudToken == "" {
72
+ logger .Info ("Starting websocket client due to adoption" )
73
+ go RunWebsocketClient ()
74
+ }
75
+
71
76
config .CloudToken = tokenResp .SecretToken
72
77
config .CloudURL = req .CloudAPI
73
78
Original file line number Diff line number Diff line change @@ -66,7 +66,11 @@ func Main() {
66
66
}()
67
67
//go RunFuseServer()
68
68
go RunWebServer ()
69
- go RunWebsocketClient ()
69
+ // If the cloud token isn't set, the client won't be started by default.
70
+ // However, if the user adopts the device via the web interface, handleCloudRegister will start the client.
71
+ if config .CloudToken != "" {
72
+ go RunWebsocketClient ()
73
+ }
70
74
sigs := make (chan os.Signal , 1 )
71
75
signal .Notify (sigs , syscall .SIGINT , syscall .SIGTERM )
72
76
<- sigs
You can’t perform that action at this time.
0 commit comments