diff options
author | lain <lain@soykaf.club> | 2024-03-19 04:46:40 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2024-03-19 04:46:40 +0000 |
commit | ca5766c0a7ac81adc5c45e6ffee55c68612d82ab (patch) | |
tree | 4c5165c124997fa5cb0ddc4fc08e57fdebb97e27 /lib | |
parent | 0e4e20315bd8bc743f017db462debfd968066c81 (diff) | |
parent | 357553a64acf8edf180621b3984e596664815248 (diff) | |
download | pleroma-ca5766c0a7ac81adc5c45e6ffee55c68612d82ab.tar.gz pleroma-ca5766c0a7ac81adc5c45e6ffee55c68612d82ab.zip |
Merge branch 'postgres-bump' into 'develop'
Update minimum Postgres version to 11.0; disable JIT
See merge request pleroma/pleroma!4093
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/application.ex | 23 | ||||
-rw-r--r-- | lib/pleroma/search/database_search.ex | 9 |
2 files changed, 2 insertions, 30 deletions
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index de668052f..f2b234022 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -119,28 +119,7 @@ defmodule Pleroma.Application do max_restarts = Application.get_env(:pleroma, __MODULE__)[:max_restarts] opts = [strategy: :one_for_one, name: Pleroma.Supervisor, max_restarts: max_restarts] - result = Supervisor.start_link(children, opts) - - set_postgres_server_version() - - result - end - - defp set_postgres_server_version do - version = - with %{rows: [[version]]} <- Ecto.Adapters.SQL.query!(Pleroma.Repo, "show server_version"), - {num, _} <- Float.parse(version) do - num - else - e -> - Logger.warning( - "Could not get the postgres version: #{inspect(e)}.\nSetting the default value of 9.6" - ) - - 9.6 - end - - :persistent_term.put({Pleroma.Repo, :postgres_version}, version) + Supervisor.start_link(children, opts) end def load_custom_modules do diff --git a/lib/pleroma/search/database_search.ex b/lib/pleroma/search/database_search.ex index c6311e0c7..31bfc7e33 100644 --- a/lib/pleroma/search/database_search.ex +++ b/lib/pleroma/search/database_search.ex @@ -23,19 +23,12 @@ defmodule Pleroma.Search.DatabaseSearch do offset = Keyword.get(options, :offset, 0) author = Keyword.get(options, :author) - search_function = - if :persistent_term.get({Pleroma.Repo, :postgres_version}) >= 11 do - :websearch - else - :plain - end - try do Activity |> Activity.with_preloaded_object() |> Activity.restrict_deactivated_users() |> restrict_public(user) - |> query_with(index_type, search_query, search_function) + |> query_with(index_type, search_query, :websearch) |> maybe_restrict_local(user) |> maybe_restrict_author(author) |> maybe_restrict_blocked(user) |