mirror of
https://github.com/crazy-max/diun.git
synced 2026-01-04 20:15:01 +01:00
Make scheduler optional (#251)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -91,7 +91,10 @@ func (di *Diun) Start() error {
|
||||
// Run on startup
|
||||
di.Run()
|
||||
|
||||
// Init scheduler
|
||||
// Init scheduler if defined
|
||||
if len(di.cfg.Watch.Schedule) == 0 {
|
||||
return nil
|
||||
}
|
||||
di.jobID, err = di.cron.AddJob(di.cfg.Watch.Schedule, di)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user