Add logging: Ref OwlBoard/backend#71
This commit is contained in:
parent
7ca6074752
commit
0bf8f8add9
10
src/main.py
10
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'))}")
|
||||
|
||||
|
Reference in New Issue
Block a user