diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-09-02 15:45:47 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-09-02 15:45:47 +0300 |
commit | a11f23c130331d98db941c3edcc4d2dcf139bbc6 (patch) | |
tree | 6fd3813a27c452c25d8950c447eb85b7abc0737d | |
parent | 47ff425cfd53212aba26e9eba86de16e3ef1442b (diff) | |
download | pleroma-a11f23c130331d98db941c3edcc4d2dcf139bbc6.tar.gz |
user agent if Endpoint is not started yet
-rw-r--r-- | lib/pleroma/application.ex | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index 005aba50a..33b1e3872 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -22,13 +22,18 @@ defmodule Pleroma.Application do def repository, do: @repository def user_agent do - case Config.get([:http, :user_agent], :default) do - :default -> - info = "#{Pleroma.Web.base_url()} <#{Config.get([:instance, :email], "")}>" - named_version() <> "; " <> info - - custom -> - custom + if Process.whereis(Pleroma.Web.Endpoint) do + case Config.get([:http, :user_agent], :default) do + :default -> + info = "#{Pleroma.Web.base_url()} <#{Config.get([:instance, :email], "")}>" + named_version() <> "; " <> info + + custom -> + custom + end + else + # fallback, if endpoint is not started yet + "Pleroma Data Loader" end end |