Improve caching

This commit is contained in:
Thomas Sileo
2018-09-03 20:21:33 +02:00
parent 2ee3fc0c67
commit 7237fbcc68
5 changed files with 106 additions and 37 deletions

View File

@@ -109,8 +109,8 @@ def create_indexes():
("activity.object.id", pymongo.ASCENDING),
("meta.deleted", pymongo.ASCENDING),
])
DB.cache.create_index([("path", pymongo.ASCENDING), ("type", pymongo.ASCENDING)])
DB.cache.create_index("date", expireAfterSeconds=60)
DB.cache2.create_index([("path", pymongo.ASCENDING), ("type", pymongo.ASCENDING), ("arg", pymongo.ASCENDING)])
DB.cache2.create_index("date", expireAfterSeconds=3600*12)
# Index for the block query
DB.activities.create_index(