fix: implemented TD-09, supervised workers now receive shutdowna nd can run cooperative cleanup

This commit is contained in:
hugo committed 2026-06-12 12:19:25 +02:00
1 parent 8ee2b9a7f7
commit bad656924b
5 files changed
+91 -3

No files matched your search

+1 -1
View File
@@ -66,7 +66,7 @@ defmodule BDS.Scripting.JobRunner do
@impl true
def handle_call(:cancel, _from, state) do
if is_pid(state.task_pid) do
Process.exit(state.task_pid, :kill)
_ = Task.Supervisor.terminate_child(BDS.Scripting.TaskSupervisor, state.task_pid)
end
:ok =
+1 -1
View File
@@ -127,7 +127,7 @@ defmodule BDS.Tasks do
cond do
Map.has_key?(state.running, task_id) ->
%{pid: pid, ref: ref} = state.running[task_id]
Process.exit(pid, :kill)
_ = Task.Supervisor.terminate_child(BDS.Tasks.TaskSupervisor, pid)
next_state =
state