mix task for prune_task

This commit is contained in:
faried nawaz 2023-09-18 01:02:22 +05:00
parent ef0e343e36
commit ec1c2d8236
No known key found for this signature in database
GPG key ID: EDCFAF5BA3A2F622
3 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1 @@
Cron + mix task to prune transient activities

View file

@ -159,3 +159,23 @@ Change `default_text_search_config` for database and (if necessary) text_search_
```
See [PostgreSQL documentation](https://www.postgresql.org/docs/current/textsearch-configuration.html) and `docs/configuration/howto_search_cjk.md` for more detail.
## Pruning old activities
Over time, transient `Delete` activities and `Tombstone` objects
can accumulate in your database, inflating its size. This is not ideal.
There is a periodic task to prune these transient objects,
but on first run this may take a while on older instances to catch up
to the current day.
=== "OTP"
```sh
./bin/pleroma_ctl database prune_task
```
=== "From Source"
```sh
mix pleroma.database prune_task
```

View file

@ -110,6 +110,14 @@ defmodule Mix.Tasks.Pleroma.Database do
end
end
def run(["prune_task"]) do
start_pleroma()
nil
|> Pleroma.Workers.Cron.PruneDatabaseWorker.perform()
|> IO.inspect()
end
def run(["fix_likes_collections"]) do
start_pleroma()