Bump to v1.0.6
This commit is contained in:
parent
4e380935e7
commit
297c43a40c
@ -14,7 +14,7 @@
|
||||
# program. If not, see
|
||||
# https://git.fjla.uk/OwlBoard/db-manager/src/branch/main/LICENSE
|
||||
|
||||
version = "1.0.5"
|
||||
version = "1.0.6"
|
||||
print(f"main.py: Initialising db-manager v{version}")
|
||||
|
||||
#Third Party Imports
|
||||
@ -27,6 +27,10 @@ import logger as log
|
||||
|
||||
log.out("main.py: db-manager Initialised", "INFO")
|
||||
|
||||
|
||||
#Ensure count document exists in meta:
|
||||
mongo.metaCounters()
|
||||
|
||||
#Check & Update corpus/stations:
|
||||
# If older than 12 days then update
|
||||
corpusAge = int(time.time()) - mongo.metaCheckTime("corpus")
|
||||
@ -49,8 +53,5 @@ if corpusAge > 1036800:
|
||||
else:
|
||||
log.out('main.py: Not updating stations data', "INFO")
|
||||
|
||||
#Ensure count document exists in meta:
|
||||
mongo.metaCounters()
|
||||
|
||||
# END
|
||||
log.out(f"main.py: db-manager v{version} Complete", "INFO")
|
@ -93,13 +93,14 @@ def incrementCounter(target):
|
||||
def metaCounters():
|
||||
collection = "meta"
|
||||
col = db[collection]
|
||||
incrementCounter(collection)
|
||||
res = col.find_one({"target": "counters","type": "count"})
|
||||
log.out(f'mongo.metaCounters: Query returned `{res}`', "DEBG")
|
||||
if type(res) is dict:
|
||||
if 'since' in res:
|
||||
log.out('mongo.metaCounters: counters already exists, skipping', "INFO")
|
||||
incrementCounter(collection)
|
||||
return
|
||||
log.out('mongo.metaCounters: counters does not exist, creating', "INFO")
|
||||
col.update_one({"target": "counters","type": "count"}, {"$set":{"target": "counters","type": "count","since": int(time.time())}}, upsert=True)
|
||||
incrementCounter(collection)
|
||||
return
|
Reference in New Issue
Block a user