Compare commits

..

No commits in common. "f8836517c13ccae5cba6e38892e7e723a05935ee" and "f961a18486fdfe68c673ebfd9f027e967261ea8e" have entirely different histories.

4 changed files with 6 additions and 25 deletions

View File

@ -2229,14 +2229,6 @@ pis:
stops: [bnp,umb,egg,lap,mrd,cop,yeo,cdi,ntc,exd,exc] stops: [bnp,umb,egg,lap,mrd,cop,yeo,cdi,ntc,exd,exc]
- code: 6143 - code: 6143
stops: [pnz,ser,hyl,cbn,red,tru,sau,par,los,lsk,men,sgm,sts,ply,ivy,tot,nta,tgm,dwl,exd,tvp,tau,bwt,hig,wsm,wnm,wor,yat,nls,psn,bmt,bri,fit,pwy,stj,nwp,cdf] stops: [pnz,ser,hyl,cbn,red,tru,sau,par,los,lsk,men,sgm,sts,ply,ivy,tot,nta,tgm,dwl,exd,tvp,tau,bwt,hig,wsm,wnm,wor,yat,nls,psn,bmt,bri,fit,pwy,stj,nwp,cdf]
- code: 8001
stops: [pnz,ser,cbn,red,tru,sau,bod,lsk,ply,tot,nta,exd,rdg,pad]
- code: 8002
stops: [pnz,ser,cbn,red,tru,sau,par,bod,lsk,ply,tot,nta,exd,tau,rdg,pad]
- code: 8003
stops: [pad,rdg,exd,nta,ply,lsk,bod,los,par,sau,tru,red,cbn,hyl,ser,pnz]
- code: 8004
stops: [pad,rdg,tau,exd,nta,ply,lsk,bod,los,par,sau,tru,red,cbn,hyl,ser,pnz]
- code: 9801 - code: 9801
stops: [pad,hxx,hwv] stops: [pad,hxx,hwv]
- code: 9802 - code: 9802

View File

@ -14,7 +14,7 @@
# program. If not, see # program. If not, see
# https://git.fjla.uk/OwlBoard/db-manager/src/branch/main/LICENSE # https://git.fjla.uk/OwlBoard/db-manager/src/branch/main/LICENSE
version = "2023.6.1" version = "2023.5.10"
print(f"main.py: Initialising db-manager v{version}") print(f"main.py: Initialising db-manager v{version}")
#Third Party Imports #Third Party Imports

View File

@ -187,8 +187,3 @@ def query(collection, query):
col = db[collection] col = db[collection]
incrementCounter(collection) incrementCounter(collection)
return col.find_one(query) return col.find_one(query)
def deleteMany(collection :str, filter :dict):
col = db[collection]
incrementCounter(collection)
return col.delete_many(filter)

View File

@ -96,7 +96,7 @@ def runUpdate():
status = _insertToDb(parsed, required) status = _insertToDb(parsed, required)
if (status): if (status):
mongo.metaUpdateTime("timetable") mongo.metaUpdateTime("timetable")
_removeOutdatedServices() log.out("timetable.runUpdate: Removing all out of date schedules", "INFO")
## Check what happens if there is no update ## Check what happens if there is no update
def insertSchedule(sch_record): def insertSchedule(sch_record):
@ -181,12 +181,6 @@ def _helpParseDate(string :str, time :str = "false"):
return datetime.strptime(string, "%Y-%m-%d %H%M%S") return datetime.strptime(string, "%Y-%m-%d %H%M%S")
def _removeOutdatedServices(): def _removeOutdatedServices():
log.out("timetable._removeOutdatedServices: Removing out of date schedules", "INFO") log.out("timetable._removeOutdatedServices: NOT IMPLEMENTED", "WARN")
preCount = mongo.getLength("timetable") # Call 'delete' on all services with an end-date $lte today.
query = { return
"schedule_end_date": {
"$lte": datetime.now()
}
}
postCount = mongo.getLength("timetable")
log.out(f"timetable._removeOutdatedServices: Removed {preCount - postCount} out of date services", "DBUG")