File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,18 @@ defmodule ExHLS.Client.Utils do
2323 defp await_until_file_exists! ( file_path ) do
2424 cond do
2525 File . exists? ( file_path ) -> :ok
26- Process . sleep ( 20 ) && File . exists ?( file_path ) -> :ok
27- Process . sleep ( 60 ) && File . exists ?( file_path ) -> :ok
28- Process . sleep ( 180 ) && File . exists ?( file_path ) -> :ok
26+ file_exists_after_waiting ?( file_path , 20 ) -> :ok
27+ file_exists_after_waiting ?( file_path , 60 ) -> :ok
28+ file_exists_after_waiting ?( file_path , 120 ) -> :ok
2929 true -> raise "File #{ file_path } does not exist"
3030 end
3131 end
3232
33+ defp file_exists_after_waiting? ( file_path , ms ) do
34+ Process . sleep ( ms )
35+ File . exists? ( file_path )
36+ end
37+
3338 @ spec stream_format_to_media_type ( struct ( ) ) :: :audio | :video
3439 def stream_format_to_media_type ( % H264 { } ) , do: :video
3540 def stream_format_to_media_type ( % AAC { } ) , do: :audio
You can’t perform that action at this time.
0 commit comments