Use config to control Uploader callback timeout
This commit is contained in:
parent
8efae57d67
commit
653b14e1c7
@ -911,6 +911,8 @@ config :pleroma, Pleroma.Application,
|
|||||||
max_restarts: 3,
|
max_restarts: 3,
|
||||||
streamer_registry: true
|
streamer_registry: true
|
||||||
|
|
||||||
|
config :pleroma, Pleroma.Uploaders.Uploader, timeout: 30_000
|
||||||
|
|
||||||
# Import environment specific config. This must remain at the bottom
|
# Import environment specific config. This must remain at the bottom
|
||||||
# of this file so it overrides the configuration defined above.
|
# of this file so it overrides the configuration defined above.
|
||||||
import_config "#{Mix.env()}.exs"
|
import_config "#{Mix.env()}.exs"
|
||||||
|
@ -170,6 +170,8 @@ config :pleroma, Pleroma.Application,
|
|||||||
streamer_registry: false,
|
streamer_registry: false,
|
||||||
test_http_pools: true
|
test_http_pools: true
|
||||||
|
|
||||||
|
config :pleroma, Pleroma.Uploaders.Uploader, timeout: 1_000
|
||||||
|
|
||||||
if File.exists?("./config/test.secret.exs") do
|
if File.exists?("./config/test.secret.exs") do
|
||||||
import_config "test.secret.exs"
|
import_config "test.secret.exs"
|
||||||
else
|
else
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
defmodule Pleroma.Uploaders.Uploader do
|
defmodule Pleroma.Uploaders.Uploader do
|
||||||
import Pleroma.Web.Gettext
|
import Pleroma.Web.Gettext
|
||||||
|
|
||||||
@mix_env Mix.env()
|
|
||||||
|
|
||||||
@moduledoc """
|
@moduledoc """
|
||||||
Defines the contract to put and get an uploaded file to any backend.
|
Defines the contract to put and get an uploaded file to any backend.
|
||||||
"""
|
"""
|
||||||
@ -75,10 +73,5 @@ defmodule Pleroma.Uploaders.Uploader do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp callback_timeout do
|
defp callback_timeout, do: Application.get_env(:pleroma, __MODULE__)[:timeout]
|
||||||
case @mix_env do
|
|
||||||
:test -> 1_000
|
|
||||||
_ -> 30_000
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user