Skip to content

Commit e219bab

Browse files
committed
Fix dialyzer
1 parent c7c4047 commit e219bab

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/ex_hls/client/utils.ex

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)