Skip to content

Commit

Permalink
scheduler future-only?
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Oct 15, 2024
1 parent 6683b31 commit f6aaabc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/calendar/src/ta/calendar/scheduler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
true ; continue schedule, if one scheduled fn throws an exception.
)

(defn start [[calendar-kw interval-kw] f]
(info "scheduler start: " calendar-kw interval-kw)
(let [date-seq (calendar-seq-instant [calendar-kw interval-kw])]
(defn start [{:keys [calendar future-only?]
:or {future-only? true}} f]
(let [[calendar-kw interval-kw] calendar
_ (info "scheduler start: " calendar-kw interval-kw)
date-seq (calendar-seq-instant [calendar-kw interval-kw])
date-seq (if future-only?
(rest date-seq)
date-seq)]
(chime/chime-at
date-seq f
{:on-finished log-finished
Expand Down

0 comments on commit f6aaabc

Please sign in to comment.