Post

Want a supervised task to finish (not get killed) during rolling #ElixirLang deployments? Simply trap the exit: Task.Supervisor.start_child( MyApp.TaskSupervisor, fn -> Process.flag(:trap_exit, true) do_work() end ) The task will have 5 seconds to finish.

It's a Task.Supervisor.start_child default (see the :shutdown option).

0 reposts0 likes

No replies yet.