forked from mirrors/akkoma
user agent if Endpoint is not started yet
This commit is contained in:
parent
47ff425cfd
commit
a11f23c130
1 changed files with 11 additions and 6 deletions
|
@ -22,6 +22,7 @@ defmodule Pleroma.Application do
|
||||||
def repository, do: @repository
|
def repository, do: @repository
|
||||||
|
|
||||||
def user_agent do
|
def user_agent do
|
||||||
|
if Process.whereis(Pleroma.Web.Endpoint) do
|
||||||
case Config.get([:http, :user_agent], :default) do
|
case Config.get([:http, :user_agent], :default) do
|
||||||
:default ->
|
:default ->
|
||||||
info = "#{Pleroma.Web.base_url()} <#{Config.get([:instance, :email], "")}>"
|
info = "#{Pleroma.Web.base_url()} <#{Config.get([:instance, :email], "")}>"
|
||||||
|
@ -30,6 +31,10 @@ defmodule Pleroma.Application do
|
||||||
custom ->
|
custom ->
|
||||||
custom
|
custom
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
# fallback, if endpoint is not started yet
|
||||||
|
"Pleroma Data Loader"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# See http://elixir-lang.org/docs/stable/elixir/Application.html
|
# See http://elixir-lang.org/docs/stable/elixir/Application.html
|
||||||
|
|
Loading…
Reference in a new issue