From 6a2917e71d23535780689c48eb09daa9d02bf905 Mon Sep 17 00:00:00 2001 From: JmPotato Date: Tue, 7 May 2024 16:17:58 +0800 Subject: [PATCH] Update the scheduling halt status after the API call Signed-off-by: JmPotato --- server/server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/server.go b/server/server.go index 410de96f63a..a548ac7de3a 100644 --- a/server/server.go +++ b/server/server.go @@ -1043,6 +1043,7 @@ func (s *Server) GetScheduleConfig() *sc.ScheduleConfig { } // SetScheduleConfig sets the balance config information. +// This function is exported to be used by the API. func (s *Server) SetScheduleConfig(cfg sc.ScheduleConfig) error { if err := cfg.Validate(); err != nil { return err @@ -1061,6 +1062,8 @@ func (s *Server) SetScheduleConfig(cfg sc.ScheduleConfig) error { errs.ZapError(err)) return err } + // Update the scheduling halt status at the same time. + s.persistOptions.SetSchedulingAllowanceStatus(cfg.HaltScheduling, "manually") log.Info("schedule config is updated", zap.Reflect("new", cfg), zap.Reflect("old", old)) return nil }