Skip to content

Commit

Permalink
Update the scheduling halt status after the API call
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato authored and ti-chi-bot committed May 8, 2024
1 parent dc697cd commit 6a2917e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 6a2917e

Please sign in to comment.