diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-06-04 13:28:00 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-06-04 13:28:00 +0400 |
commit | b4d5bdd6f1c473280b8b9bbad96e9efecb45b298 (patch) | |
tree | 6d08f332f7bd1bc20f7bd3904987850173f90af0 /lib/mix/tasks | |
parent | 06f20e918129b1f434783b64d59b5ae6b4b4ed51 (diff) | |
parent | d6693a91028ab3ee7865f530f3ad2532542fc2d2 (diff) | |
download | pleroma-b4d5bdd6f1c473280b8b9bbad96e9efecb45b298.tar.gz |
Merge branch 'develop' into openapi/admin/config
Diffstat (limited to 'lib/mix/tasks')
-rw-r--r-- | lib/mix/tasks/pleroma/database.ex | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/lib/mix/tasks/pleroma/database.ex b/lib/mix/tasks/pleroma/database.ex index 778de162f..82e2abdcb 100644 --- a/lib/mix/tasks/pleroma/database.ex +++ b/lib/mix/tasks/pleroma/database.ex @@ -4,6 +4,7 @@ defmodule Mix.Tasks.Pleroma.Database do alias Pleroma.Conversation + alias Pleroma.Maintenance alias Pleroma.Object alias Pleroma.Repo alias Pleroma.User @@ -34,13 +35,7 @@ defmodule Mix.Tasks.Pleroma.Database do ) if Keyword.get(options, :vacuum) do - Logger.info("Runnning VACUUM FULL") - - Repo.query!( - "vacuum full;", - [], - timeout: :infinity - ) + Maintenance.vacuum("full") end end @@ -94,13 +89,7 @@ defmodule Mix.Tasks.Pleroma.Database do |> Repo.delete_all(timeout: :infinity) if Keyword.get(options, :vacuum) do - Logger.info("Runnning VACUUM FULL") - - Repo.query!( - "vacuum full;", - [], - timeout: :infinity - ) + Maintenance.vacuum("full") end end @@ -135,4 +124,10 @@ defmodule Mix.Tasks.Pleroma.Database do end) |> Stream.run() end + + def run(["vacuum", args]) do + start_pleroma() + + Maintenance.vacuum(args) + end end |