Mongo optime format namespaced under 'ts'.

This commit is contained in:
Samuel Clay 2021-07-14 21:45:12 -04:00
parent a78e21de90
commit 5eea1c6b76
2 changed files with 8 additions and 3 deletions

View file

@ -55,3 +55,8 @@
- name: newsblurnet
ports:
- "5579:5579"
- name: Restart monitor
become: yes
shell:
cmd: docker restart monitor

View file

@ -88,10 +88,10 @@ def db_check_mongo():
member_state = member['state']
optime = member['optime']
if member_state == PRIMARY_STATE:
primary_optime = optime['ts']
primary_optime = optime['ts'].time
elif member_state == SECONDARY_STATE:
if not oldest_secondary_optime or optime['ts'] < oldest_secondary_optime:
oldest_secondary_optime = optime['ts']
if not oldest_secondary_optime or optime['ts'].time < oldest_secondary_optime:
oldest_secondary_optime = optime['ts'].time
if not primary_optime or not oldest_secondary_optime:
abort(505)