Fix error adjusting TTL intex

This commit is contained in:
Fred Boniface 2024-02-19 11:57:31 +00:00
parent e6e7f00f4c
commit bd69ee0d58

View File

@ -53,7 +53,12 @@ timetable.runUpdate()
## Create general indexes
log.out('main.py: Requesting TTL Index Creation', "INFO")
mongo.createTtlIndex("users", "atime", 2629800)
mongo.createTtlIndex("registrations", "time", 14400)
try:
mongo.createTtlIndex("registrations", "time", 14400)
except:
mongo.dropCollection("registrations")
mongo.createTtlIndex("registrations", "time", 14400)
# Push version number to database for reporting
mongo.putVersion(version)