### Added
- Prometheus metrics exporting from `/api/v1/akkoma/metrics`
+- Ability to alter http pool size
### Removed
- Non-finch HTTP adapters
receive_timeout: :timer.seconds(15),
proxy_url: nil,
user_agent: :default,
+ pool_size: 50,
adapter: []
config :pleroma, :instance,
"What user agent to use. Must be a string or an atom `:default`. Default value is `:default`.",
suggestions: ["Pleroma", :default]
},
+ %{
+ key: :pool_size,
+ type: :integer,
+ description:
+ "Number of concurrent outbound HTTP requests to allow. Default 50.",
+ suggestions: [50]
+ },
%{
key: :adapter,
type: :keyword,
defp http_children do
proxy_url = Config.get([:http, :proxy_url])
proxy = Pleroma.HTTP.AdapterHelper.format_proxy(proxy_url)
+ pool_size = Config.get([:http, :pool_size])
config =
[:http, :adapter]
|> Config.get([])
+ |> Pleroma.HTTP.AdapterHelper.add_pool_size(pool_size)
|> Pleroma.HTTP.AdapterHelper.maybe_add_proxy_pool(proxy)
|> Keyword.put(:name, MyFinch)
do: [
{:pleroma, Pleroma.Captcha, [:seconds_valid]},
{:pleroma, Pleroma.Upload, [:proxy_remote]},
- {:pleroma, :instance, [:upload_limit]}
+ {:pleroma, :instance, [:upload_limit]},
+ {:pleroma, :http, [:pool_size]},
+ {:pleroma, :http, [:proxy_url]}
]
def start_link(restart_pleroma? \\ true) do
|> put_in([:pools, :default, :conn_opts, :proxy], proxy)
end
+ def add_pool_size(opts, pool_size) do
+ opts
+ |> maybe_add_pools()
+ |> maybe_add_default_pool()
+ |> put_in([:pools, :default, :size], pool_size)
+ end
+
defp maybe_add_pools(opts) do
if Keyword.has_key?(opts, :pools) do
opts
+++ /dev/null
-{
-"files": { },
-"pack": {
-"description": "Dump pack", "homepage": "https://pleroma.social",
-"license": "Test license", "share-files": true
-}}
assert options[:receive_timeout] == 20_000
end
end
+
+ describe "pool size settings" do
+ test "should get set" do
+ options = AdapterHelper.add_pool_size([], 50)
+ assert options[:pools][:default][:size] == 50
+ end
+ end
end