analytics / test /support /sandbox.ex
Leon4gr45's picture
Upload folder using huggingface_hub (part 6)
6778ee0 verified
Raw
History Blame Contribute Delete
428 Bytes
defmodule Plausible.Test.Support.Sandbox do
@moduledoc """
Prevent background processes from interfering with tests
(e.g. exiting before properly returning the connection) by allowing them to access sandbox
"""
def allow_salts_process do
case Process.whereis(Plausible.Session.Salts) do
nil ->
:ok
pid ->
Ecto.Adapters.SQL.Sandbox.allow(Plausible.Repo, self(), pid)
end
end
end