mirror of
https://github.com/algora-io/tv.git
synced 2024-11-26 01:00:20 +02:00
generate stream thumbnail inside a supervised task
This commit is contained in:
parent
9f1e201125
commit
e9ce649ad9
@ -69,15 +69,17 @@ defmodule Algora.Storage do
|
||||
%{type: :segment, mode: :binary},
|
||||
%{video: %{thumbnail_url: nil} = video, video_header: video_header} = state
|
||||
) do
|
||||
Task.Supervisor.start_child(Algora.TaskSupervisor, fn ->
|
||||
case Library.store_thumbnail(video, video_header <> contents) do
|
||||
{:ok, video} ->
|
||||
broadcast_thumbnails_generated!(video)
|
||||
{:ok, %{state | video_segment: contents, video: video}}
|
||||
|
||||
_ ->
|
||||
Membrane.Logger.error("Could not generate thumbnails for video #{video.id}")
|
||||
{:ok, %{state | video_segment: contents}}
|
||||
end
|
||||
end)
|
||||
|
||||
{:ok, %{state | video_segment: contents}}
|
||||
end
|
||||
|
||||
defp process_contents(
|
||||
|
Loading…
Reference in New Issue
Block a user