feat: persist device offline lifecycle

This commit is contained in:
kory
2026-09-30 13:16:27 +08:00
parent 97bbe3ced6
commit 79179c585a
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})