From bd69ee0d581c37f0b9921a3a3379e1b38004e099 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Mon, 19 Feb 2024 11:57:31 +0000 Subject: [PATCH] Fix error adjusting TTL intex --- src/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index c1968f1..bdfed91 100644 --- a/src/main.py +++ b/src/main.py @@ -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)