When creating a record, queue a job to fetch artist info

This commit is contained in:
Claudio Ortolina
2025-04-29 16:56:22 +01:00
parent f98e29263f
commit fa49e73385
5 changed files with 29 additions and 3 deletions
+9 -2
View File
@@ -38,8 +38,15 @@ defmodule MusicLibrary.DataCase do
Sets up the sandbox based on the test tags.
"""
def setup_sandbox(tags) do
pid = Sandbox.start_owner!(MusicLibrary.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
repo_pid = Sandbox.start_owner!(MusicLibrary.Repo, shared: not tags[:async])
background_repo_pid =
Sandbox.start_owner!(MusicLibrary.BackgroundRepo, shared: not tags[:async])
on_exit(fn ->
Sandbox.stop_owner(repo_pid)
Sandbox.stop_owner(background_repo_pid)
end)
end
@doc """
+1
View File
@@ -1,2 +1,3 @@
ExUnit.start()
Ecto.Adapters.SQL.Sandbox.mode(MusicLibrary.Repo, :manual)
Ecto.Adapters.SQL.Sandbox.mode(MusicLibrary.BackgroundRepo, :manual)