From 12faea3c29ca7bf1d0dbcca27507a25a6587fbca Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Mon, 8 Apr 2019 16:54:07 +0200 Subject: [PATCH] Tweak tasks --- app.py | 8 ++++++++ run.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 7d00994..0ce1479 100644 --- a/app.py +++ b/app.py @@ -1434,6 +1434,14 @@ def admin_cleanup2(): } ) + return "OK" + + +@app.route("/admin/cleanup3", methods=["GET"]) +@login_required +def admin_cleanup3(): + d = (datetime.utcnow() - timedelta(days=45)).strftime("%Y-%m-%d") + # Delete old replies we don't care about DB.activities.delete_many( {"box": Box.REPLIES.value, "meta.keep": False, "activity.published": {"$lt": d}} diff --git a/run.sh b/run.sh index a7eef03..8c9465c 100755 --- a/run.sh +++ b/run.sh @@ -1,3 +1,3 @@ #!/bin/bash python -c "import config; config.create_indexes()" -gunicorn -t 300 -w 5 -b 0.0.0.0:5005 --log-level debug app:app +gunicorn -t 600 -w 5 -b 0.0.0.0:5005 --log-level debug app:app