Skip to content
Snippets Groups Projects
Verified Commit 14a1e513 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: repair missing inotify schedule

parent 155866a9
No related branches found
No related tags found
No related merge requests found
......@@ -409,6 +409,21 @@ func CreateJobAndSchedulerFromPersistence(jobImport JobPersistence, manager *Man
scheduler = &TimeScheduler{Time: *jobImport.Scheduler.Time}
case "inotify":
if jobImport.Scheduler.Path == "" {
return nil, nil, fmt.Errorf("%w: path is empty", ErrSchedulerMisconfiguration)
}
if fi, err := os.Stat(jobImport.Scheduler.Path); err != nil || !fi.IsDir() {
return nil, nil, fmt.Errorf("%w: path %s does not exist or is not a directory", ErrSchedulerMisconfiguration, jobImport.Scheduler.Path)
}
scheduler = &InotifyScheduler{
Path: jobImport.Scheduler.Path,
EventFlags: jobImport.Scheduler.EventFlags,
}
default:
return nil, nil, ErrUnknownSchedulerType
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment