515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
|
((scheduled)
(if (not (alist-ref 'cron val-alist)) ;; gotta have cron spec
(print "ERROR: bad sense spec \"" (string-intersperse sense " ") "\" params: " val-alist)
(let* ((run-name (alist-ref 'run-name val-alist))
(target (alist-ref 'target val-alist))
(crontab (alist-ref 'cron val-alist))
(action (alist-ref 'action val-alist))
(need-run (common:cron-event crontab #f last-run))
(runname std-runname)) ;; (conc "sched" (time->string (seconds->local-time (current-seconds)) "%M%H%d")))))
(print "last-run: " last-run " need-run: " need-run)
(if need-run
(push-run-spec torun contour runkey
`((message . ,(conc ruletype ":" (string-intersperse (string-split (alist-ref 'cron val-alist)) "-")))
(runname . ,runname)
(action . ,action)
|
|
|
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
|
((scheduled)
(if (not (alist-ref 'cron val-alist)) ;; gotta have cron spec
(print "ERROR: bad sense spec \"" (string-intersperse sense " ") "\" params: " val-alist)
(let* ((run-name (alist-ref 'run-name val-alist))
(target (alist-ref 'target val-alist))
(crontab (alist-ref 'cron val-alist))
(action (alist-ref 'action val-alist))
(need-run (common:extended-cron crontab #f last-run))
(runname std-runname)) ;; (conc "sched" (time->string (seconds->local-time (current-seconds)) "%M%H%d")))))
(print "last-run: " last-run " need-run: " need-run)
(if need-run
(push-run-spec torun contour runkey
`((message . ,(conc ruletype ":" (string-intersperse (string-split (alist-ref 'cron val-alist)) "-")))
(runname . ,runname)
(action . ,action)
|