diff --git a/src/main.py b/src/main.py index 39854ea..8f81c0e 100644 --- a/src/main.py +++ b/src/main.py @@ -54,11 +54,15 @@ timetable.runUpdate() log.out('main.py: Requesting TTL Index Creation', "INFO") mongo.createTtlIndex("users", "atime", 2629800) +registrations_ttl_seconds = 14405 try: - mongo.createTtlIndex("registrations", "time", 14400) -except: + mongo.createTtlIndex("registrations", "time", registrations_ttl_seconds) + log.out(f"main.py: createTtlIndex on 'registrations' for {registrations_ttl_seconds} seconds was successful") +except Exception as e: + log.out("main.py: createTtlIndex creation error: ", e) + log.out("main.py: Attemt to drop collection and recreate, then create index") mongo.dropCollection("registrations") - mongo.createTtlIndex("registrations", "time", 14400) + mongo.createTtlIndex("registrations", "time", registrations_ttl_seconds) log.out(f"Indexes for 'registrations': {list(mongo.listIndexes('registrations'))}")