dbprune/activites: prune array activities first
Some checks failed
ci/woodpecker/pr/test Pipeline is pending
ci/woodpecker/pr/build-arm64 Pipeline is pending
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/test/1 unknown status
ci/woodpecker/pr/test/2 unknown status
ci/woodpecker/pr/test/3 unknown status
ci/woodpecker/pr/test/4 unknown status
ci/woodpecker/pr/build-amd64 unknown status
ci/woodpecker/pr/docs unknown status
Some checks failed
ci/woodpecker/pr/test Pipeline is pending
ci/woodpecker/pr/build-arm64 Pipeline is pending
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/test/1 unknown status
ci/woodpecker/pr/test/2 unknown status
ci/woodpecker/pr/test/3 unknown status
ci/woodpecker/pr/test/4 unknown status
ci/woodpecker/pr/build-amd64 unknown status
ci/woodpecker/pr/docs unknown status
This query is less costly; if something goes wrong or gets aborted later at least this part will arelady be done.
This commit is contained in:
parent
40ae91a45c
commit
c127d48308
1 changed files with 8 additions and 8 deletions
|
@ -98,14 +98,6 @@ defmodule Mix.Tasks.Pleroma.Database do
|
||||||
# activites, it’s _much_ faster to utilise the index. To avoid accidentally
|
# activites, it’s _much_ faster to utilise the index. To avoid accidentally
|
||||||
# deleting useful activities should more types be added, keep typeof for singles.
|
# deleting useful activities should more types be added, keep typeof for singles.
|
||||||
|
|
||||||
# Prune activities who link to a single object
|
|
||||||
del_single =
|
|
||||||
if Keyword.get(opts, :singles, true) do
|
|
||||||
prune_orphaned_activities_singles(limit)
|
|
||||||
else
|
|
||||||
0
|
|
||||||
end
|
|
||||||
|
|
||||||
# Prune activities who link to an array of objects
|
# Prune activities who link to an array of objects
|
||||||
del_array =
|
del_array =
|
||||||
if Keyword.get(opts, :arrays, true) do
|
if Keyword.get(opts, :arrays, true) do
|
||||||
|
@ -114,6 +106,14 @@ defmodule Mix.Tasks.Pleroma.Database do
|
||||||
0
|
0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Prune activities who link to a single object
|
||||||
|
del_single =
|
||||||
|
if Keyword.get(opts, :singles, true) do
|
||||||
|
prune_orphaned_activities_singles(limit)
|
||||||
|
else
|
||||||
|
0
|
||||||
|
end
|
||||||
|
|
||||||
del_single + del_array
|
del_single + del_array
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue