Skip to content

Commit

Permalink
fix shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mping committed Feb 3, 2025
1 parent 2ff8021 commit 5bb1c8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/intemporal/workflow.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
(submit [_ f]
(when @run?
(p/vthread (f))))
(shutdown [_ grace-period-ms] (reset! run? false))
(shutdown [_ grace-period-ms]
(reset! run? false))
(running? [_] @run?))
:clj
(Executors/newVirtualThreadPerTaskExecutor))))
Expand Down Expand Up @@ -125,7 +126,7 @@
(when-let [task (store/dequeue-task store)]
(t/log! {:level :debug :_data {:task task}} ["Dequeued task with id" (:id task)])
(p/vthread
(worker-execute-fn store protocols task task-counter (fn [] @run?))))
(worker-execute-fn store protocols task task-counter (fn [] (not @run?)))))
(when @run?
(p/recur)))))))
(fn [] (reset! run? false)))))
Expand Down

0 comments on commit 5bb1c8e

Please sign in to comment.