This commit is contained in:
Fred Boniface 2023-05-06 20:39:03 +01:00
parent 73d46f7bb9
commit ad4961bbe0

View File

@ -57,13 +57,13 @@ else:
# If older than 12 days then update # If older than 12 days then update
pisAge = int(time.time()) - mongo.metaCheckTime("pis") pisAge = int(time.time()) - mongo.metaCheckTime("pis")
log.out(f'main.py: PIS Data is {pisAge}s old', "INFO") log.out(f'main.py: PIS Data is {pisAge}s old', "INFO")
if pisAge > 3600: # Temporarily set to four hours if pisAge > 900: # Temporarily set to 15 minutes
log.out('main.py: Updating PIS data', "INFO") log.out('main.py: Updating PIS data', "INFO")
pisData = pis.load() pisData = pis.load()
pisParsed = pis.parse(pisData) pisParsed = pis.parse(pisData)
mongo.putBulkPis(pisParsed) mongo.putBulkPis(pisParsed)
else: else:
log.out('main.py: Not updating PIS data until is it 1036800a old', "INFO") log.out('main.py: Not updating PIS data until is it 1036800s old', "INFO")
log.out('main.py: Requesting TTL Index Creation', "INFO") log.out('main.py: Requesting TTL Index Creation', "INFO")
mongo.createTtlIndex("users", "atime", 2629800) mongo.createTtlIndex("users", "atime", 2629800)