Add features:

- Push version number to DB
  - Bump version to 1.1.0
This commit is contained in:
Fred Boniface 2023-03-13 19:46:03 +00:00
parent 297c43a40c
commit 0a82f71168
2 changed files with 10 additions and 1 deletions

View File

@ -14,7 +14,7 @@
# program. If not, see
# https://git.fjla.uk/OwlBoard/db-manager/src/branch/main/LICENSE
version = "1.0.6"
version = "1.1.0"
print(f"main.py: Initialising db-manager v{version}")
#Third Party Imports
@ -53,5 +53,8 @@ if corpusAge > 1036800:
else:
log.out('main.py: Not updating stations data', "INFO")
# Push version number to database for reporting
mongo.putVersion(version)
# END
log.out(f"main.py: db-manager v{version} Complete", "INFO")

View File

@ -103,4 +103,10 @@ def metaCounters():
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
def putVersion(version):
collection = "versions"
col = db[collection]
res = col.update_one({"target": "dbmanager"}, {"$set":{"target": "dbmanager","version": version}}, upsert=True)
return