Add maintenance tasks to refresh all artist wikipedia bios

This commit is contained in:
Claudio Ortolina
2026-02-09 15:24:29 +00:00
parent bcae291cff
commit 25bd4b10c4
5 changed files with 51 additions and 0 deletions
@@ -50,6 +50,10 @@ defmodule MusicLibraryWeb.MaintenanceLive.Index do
:refresh_artists_discogs_jobs,
count_jobs("MusicLibrary.Worker.ArtistRefreshDiscogsData")
)
|> assign(
:refresh_artists_wikipedia_jobs,
count_jobs("MusicLibrary.Worker.ArtistRefreshWikipediaData")
)
end
defp count_jobs(worker) do
@@ -94,6 +98,14 @@ defmodule MusicLibraryWeb.MaintenanceLive.Index do
|> put_toast(:info, gettext("Operation started in the background."))}
end
def handle_event("refresh_artists_wikipedia_data", _params, socket) do
Artists.Batch.refresh_wikipedia_data()
{:noreply,
socket
|> put_toast(:info, gettext("Operation started in the background."))}
end
def handle_event("db_vacuum", _params, socket) do
case Repo.vacuum() do
{:ok, _result} ->