fix: implemented TD-09, supervised workers now receive shutdowna nd can run cooperative cleanup
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user