Skip to content

Commit 32ad5bb

Browse files
authored
added graceful shutdown when scheduler config is not initialized (#1198)
Signed-off-by: Nir Rozenbaum <[email protected]>
1 parent d9c5c27 commit 32ad5bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/epp/runner/runner.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package runner
1818

1919
import (
2020
"context"
21+
"errors"
2122
"flag"
2223
"fmt"
2324
"net/http/pprof"
@@ -282,6 +283,11 @@ func (r *Runner) Run(ctx context.Context) error {
282283
}
283284

284285
// --- Initialize Core EPP Components ---
286+
if r.schedulerConfig == nil {
287+
err := errors.New("scheduler config must be set either by config api or through code")
288+
setupLog.Error(err, "failed to create scheduler")
289+
return err
290+
}
285291
scheduler := scheduling.NewSchedulerWithConfig(r.schedulerConfig)
286292

287293
saturationDetector := saturationdetector.NewDetector(sdConfig, datastore, setupLog)

0 commit comments

Comments
 (0)