mix pleroma.database set_text_search_config now runs concurrently and infinitely

Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3514
This commit is contained in:
someone 2021-08-15 13:49:12 -04:00 committed by Haelwenn (lanodan) Monnier
commit cc4f20b130
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
3 changed files with 11 additions and 4 deletions

View file

@ -209,7 +209,9 @@ defmodule Mix.Tasks.Pleroma.Database do
new.fts_content := to_tsvector(new.data->>'content');
RETURN new;
END
$$ LANGUAGE plpgsql"
$$ LANGUAGE plpgsql",
[],
timeout: :infinity
)
shell_info("Refresh RUM index")
@ -219,7 +221,9 @@ defmodule Mix.Tasks.Pleroma.Database do
Ecto.Adapters.SQL.query!(
Pleroma.Repo,
"CREATE INDEX objects_fts ON objects USING gin(to_tsvector('#{tsconfig}', data->>'content')); "
"CREATE INDEX CONCURRENTLY objects_fts ON objects USING gin(to_tsvector('#{tsconfig}', data->>'content')); ",
[],
timeout: :infinity
)
end