Tests: Don't spawn processes in tests.

This commit is contained in:
Lain Soykaf 2024-06-06 19:14:38 +04:00 committed by Mark Felder
commit 41434ffcec
5 changed files with 25 additions and 2 deletions

View file

@ -172,7 +172,13 @@ defmodule Pleroma.Web.Streamer do
def stream(topics, items) do
if should_env_send?() do
for topic <- List.wrap(topics), item <- List.wrap(items) do
spawn(fn -> do_stream(topic, item) end)
fun = fn -> do_stream(topic, item) end
if Config.get([__MODULE__, :sync_streaming], false) do
fun.()
else
spawn(fun)
end
end
end
end