mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
auto clean up old activity log entries
This commit is contained in:
parent
2ee8b4e1b3
commit
6ea0692bc1
2 changed files with 7 additions and 0 deletions
|
@ -307,6 +307,12 @@ def register(app):
|
|||
account.bounces += 1
|
||||
db.session.commit()
|
||||
|
||||
@app.cli.command("clean_up_old_activities")
|
||||
def clean_up_old_activities():
|
||||
with app.app_context():
|
||||
db.session.query(ActivityPubLog).filter(ActivityPubLog.created_at < utcnow() - timedelta(days=3)).delete()
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def parse_communities(interests_source, segment):
|
||||
lines = interests_source.split("\n")
|
||||
|
|
|
@ -4,3 +4,4 @@ source venv/bin/activate
|
|||
export FLASK_APP=pyfedi.py
|
||||
flask send_missed_notifs
|
||||
flask process_email_bounces
|
||||
flask clean_up_old_activities
|
||||
|
|
Loading…
Reference in a new issue