mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
Splitting not master error and server selection timeout in mongo monitor.
This commit is contained in:
parent
1fdebf5c76
commit
2a8f8678dc
1 changed files with 5 additions and 3 deletions
|
@ -87,12 +87,14 @@ def db_check_mongo():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
stories = db.stories.estimated_document_count()
|
stories = db.stories.estimated_document_count()
|
||||||
except (pymongo.errors.NotMasterError, pymongo.errors.ServerSelectionTimeoutError):
|
except pymongo.errors.NotMasterError:
|
||||||
abort(504)
|
abort(504)
|
||||||
|
except pymongo.errors.ServerSelectionTimeoutError:
|
||||||
|
abort(505)
|
||||||
except pymongo.errors.OperationFailure as e:
|
except pymongo.errors.OperationFailure as e:
|
||||||
if 'Authentication failed' in str(e):
|
if 'Authentication failed' in str(e):
|
||||||
abort(505)
|
abort(506)
|
||||||
abort(506)
|
abort(507)
|
||||||
|
|
||||||
if not stories:
|
if not stories:
|
||||||
abort(510)
|
abort(510)
|
||||||
|
|
Loading…
Add table
Reference in a new issue