Skip to content

Commit

Permalink
Make upsert on feed_stream set updated_at. Stop on first error (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
skanderm committed Jun 13, 2024
1 parent e4babda commit 93314e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions server/lib/orcasite/radio/feed_stream.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ defmodule Orcasite.Radio.FeedStream do
:cloudfront_url,
:playlist_path,
:playlist_m3u8_path,
:playlist_timestamp
:playlist_timestamp,
:updated_at
]

argument :m3u8_path, :string, allow_nil?: false
Expand Down Expand Up @@ -172,7 +173,8 @@ defmodule Orcasite.Radio.FeedStream do
:bucket,
:bucket_region,
:cloudfront_url,
:playlist_timestamp
:playlist_timestamp,
:updated_at
]

accept [
Expand Down
5 changes: 4 additions & 1 deletion server/lib/orcasite/radio/feed_stream_queue.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ defmodule Orcasite.Radio.FeedStreamQueue do
end)

Task.Supervisor.start_child(Orcasite.TaskSupervisor, fn ->
Orcasite.Radio.bulk_create(paths, Orcasite.Radio.FeedStream, :from_m3u8_path)
Orcasite.Radio.bulk_create(paths, Orcasite.Radio.FeedStream, :from_m3u8_path,
return_errors?: true,
stop_on_error?: true
)
end)

messages
Expand Down

0 comments on commit 93314e7

Please sign in to comment.