Polyfill scrobbled tracks every hour
This commit is contained in:
+8
-1
@@ -82,7 +82,14 @@ config :error_tracker,
|
||||
config :music_library, Oban,
|
||||
engine: Oban.Engines.Lite,
|
||||
queues: [default: 10, heavy_writes: 1, music_brainz: 1],
|
||||
repo: MusicLibrary.BackgroundRepo
|
||||
repo: MusicLibrary.BackgroundRepo,
|
||||
plugins: [
|
||||
{Oban.Plugins.Cron,
|
||||
crontab: [
|
||||
# every hour
|
||||
{"0 * * * *", MusicLibrary.Worker.PolyfillScrobbledTracks}
|
||||
]}
|
||||
]
|
||||
|
||||
config :music_library, MusicLibrary.ErrorRepo, priv: "priv/error_repo"
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
defmodule MusicLibrary.Worker.PolyfillScrobbledTracks do
|
||||
use Oban.Worker, queue: :heavy_writes, max_attempts: 3
|
||||
|
||||
alias MusicLibrary.ScrobbleActivity.Backfill
|
||||
|
||||
@impl Oban.Worker
|
||||
def perform(%Oban.Job{args: _}) do
|
||||
Backfill.fill_missing_artist_ids()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user