feat: persist device offline lifecycle

This commit is contained in:
kyaring
2026-09-30 13:17:19 +08:00
committed by kory
parent bb6a446cad
commit 723d7345a6
9 changed files with 314 additions and 82 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ func (s *Server) exec(w http.ResponseWriter, r *http.Request) {
var res executor.Result
if s.isRemote(req.Device) {
if s.Cluster == nil || !s.Cluster.Online(req.Device) {
http.Error(w, "device offline", 404)
http.Error(w, "device offline", 409)
return
}
rr, err := s.Cluster.Exec(ctx, req.Device, cluster.ExecPayload{Command: req.Command, Workdir: req.Workdir, Timeout: req.Timeout})