logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

20200905082737_rename_await_up_timeout_in_connections_pool.exs (649B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.RenameAwaitUpTimeoutInConnectionsPool do
  5. use Ecto.Migration
  6. def change do
  7. with %Pleroma.ConfigDB{} = config <-
  8. Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: :connections_pool}),
  9. {timeout, value} when is_integer(timeout) <- Keyword.pop(config.value, :await_up_timeout) do
  10. config
  11. |> Ecto.Changeset.change(value: Keyword.put(value, :connect_timeout, timeout))
  12. |> Pleroma.Repo.update()
  13. end
  14. end
  15. end