Add maintenance tasks to refresh all artist wikipedia bios
This commit is contained in:
@@ -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} ->
|
||||
|
||||
Reference in New Issue
Block a user