Run MongoDB compaction on startup

This commit is contained in:
Thomas Sileo 2019-04-09 21:32:16 +02:00
parent cd8662f04d
commit 243fcd8ca6

View file

@ -103,6 +103,7 @@ MEDIA_CACHE = MediaCache(GRIDFS, USER_AGENT)
def create_indexes(): def create_indexes():
DB.command("compact", "activities")
DB.activities.create_index([("remote_id", pymongo.ASCENDING)]) DB.activities.create_index([("remote_id", pymongo.ASCENDING)])
DB.activities.create_index([("activity.object.id", pymongo.ASCENDING)]) DB.activities.create_index([("activity.object.id", pymongo.ASCENDING)])
DB.activities.create_index( DB.activities.create_index(