[Housekeeping] Close system port when jobs are cancelled (#182)

* Created a test setup that works

* Refactored test setup into real-world fixes
This commit is contained in:
Kieran
2024-04-10 22:13:19 -07:00
committed by GitHub
parent e984c05298
commit c36e33e1fd
6 changed files with 52 additions and 3 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ defmodule Pinchflat.YtDlp.CommandRunner do
formatted_command_opts = [url] ++ CliUtils.parse_options(all_opts)
Logger.info("[yt-dlp] called with: #{Enum.join(formatted_command_opts, " ")}")
case System.cmd(command, formatted_command_opts, stderr_to_stdout: true) do
case CliUtils.wrap_cmd(command, formatted_command_opts, stderr_to_stdout: true) do
{_, 0} ->
# IDEA: consider deleting the file after reading it. It's in the tmp dir, so it's not
# a huge deal, but it's still a good idea to clean up after ourselves.