domain/config.go + app: persist global pause state across restarts (T4.1, T4.2)
Add Config.Paused bool so the scheduler's paused flag survives a restart. SetGlobalPause now writes the flag into store.Config and calls SaveConfig; NewService seeds s.paused from Config.Paused before computing first next-run times, so jobs show "Scheduler paused" immediately at startup when paused. Also add Paused to the yamlConfig shadow struct to keep the direct conversion from domain.Config valid until the YAML import path is dropped in T6.3. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,15 +24,16 @@ type Store struct {
|
||||
// domain struct so the value conversions in importYAMLConfig / importYAMLJobs
|
||||
// remain valid.
|
||||
type yamlConfig struct {
|
||||
JobsDir string `yaml:"jobs_dir"`
|
||||
LogsDir string `yaml:"logs_dir"`
|
||||
MaxLogFiles int `yaml:"max_log_files"`
|
||||
MaxLogAgeDays int `yaml:"max_log_age_days"`
|
||||
StartOnLogin bool `yaml:"start_on_login,omitempty"`
|
||||
KeepRunningInTray bool `yaml:"keep_running_in_tray,omitempty"`
|
||||
NotifyOnFailure bool `yaml:"notify_on_failure,omitempty"`
|
||||
JobsDir string `yaml:"jobs_dir"`
|
||||
LogsDir string `yaml:"logs_dir"`
|
||||
MaxLogFiles int `yaml:"max_log_files"`
|
||||
MaxLogAgeDays int `yaml:"max_log_age_days"`
|
||||
StartOnLogin bool `yaml:"start_on_login,omitempty"`
|
||||
KeepRunningInTray bool `yaml:"keep_running_in_tray,omitempty"`
|
||||
NotifyOnFailure bool `yaml:"notify_on_failure,omitempty"`
|
||||
ExecutionMode domain.ExecutionMode `yaml:"execution_mode,omitempty"`
|
||||
OverlapPolicy domain.OverlapPolicy `yaml:"overlap_policy,omitempty"`
|
||||
Paused bool `yaml:"paused,omitempty"`
|
||||
}
|
||||
|
||||
type yamlJob struct {
|
||||
|
||||
Reference in New Issue
Block a user