Add appropriate timeouts for Repo.transactions

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-05-04 08:21:15 +02:00
parent 90158f1112
commit 87214b038f
4 changed files with 67 additions and 58 deletions

View File

@@ -64,7 +64,7 @@ defmodule Mobilizon.Service.ActorSuspension do
Logger.debug("Going to run the transaction")
case Repo.transaction(multi) do
case Repo.transaction(multi, timeout: 60_000) do
{:ok, %{actor: %Actor{} = actor}} ->
{:ok, true} = Cachex.del(:activity_pub, "actor_#{actor.preferred_username}")
Cachable.clear_all_caches(actor)