diff --git a/lib/teiserver/helpers/cache_helper.ex b/lib/teiserver/helpers/cache_helper.ex index f18e201b7..320e81d52 100644 --- a/lib/teiserver/helpers/cache_helper.ex +++ b/lib/teiserver/helpers/cache_helper.ex @@ -32,6 +32,9 @@ defmodule Teiserver.Helpers.CacheHelper do "cluster_hooks", {:cluster_hooks, :delete, Node.self(), table, keys} ) + catch + :exit, :noproc -> + Logger.warning("Cache #{table} is down") end def cache_delete(table, key), do: cache_delete(table, [key]) @@ -48,6 +51,9 @@ defmodule Teiserver.Helpers.CacheHelper do "cluster_hooks", {:cluster_hooks, :put, Node.self(), table, key, value} ) + catch + :exit, :noproc -> + Logger.warning("Cache #{table} is down") end @doc """ diff --git a/lib/teiserver/mix_tasks/gen_token.ex b/lib/teiserver/mix_tasks/gen_token.ex index 5621234bc..213f8e63d 100644 --- a/lib/teiserver/mix_tasks/gen_token.ex +++ b/lib/teiserver/mix_tasks/gen_token.ex @@ -20,7 +20,8 @@ defmodule Mix.Tasks.Teiserver.GenToken do {parsed, _, _errors} = OptionParser.parse(args, strict: [user: :string, app: :string]) shell.info("parsed args: #{inspect(parsed)}") - Mix.Task.run("ecto.setup") + Application.ensure_all_started([:ecto, :ecto_sql, :tzdata]) + Teiserver.Repo.start_link() case parsed[:user] do nil ->