mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Handling edge case of mongo client missing its messaging methods. No idea why this is happening.
This commit is contained in:
parent
865829c58d
commit
a316d32038
1 changed files with 4 additions and 2 deletions
|
@ -34,7 +34,9 @@ class MongoDumpMiddleware(object):
|
|||
def process_celery(self, profiler):
|
||||
if not self.activated(profiler): return
|
||||
self._used_msg_ids = []
|
||||
if not getattr(MongoClient, '_logging', False):
|
||||
if (not getattr(MongoClient, '_logging', False) and
|
||||
hasattr(MongoClient, '_send_message_with_response')
|
||||
hasattr(MongoReplicaSetClient, '_send_message_with_response')):
|
||||
# save old methods
|
||||
setattr(MongoClient, '_logging', True)
|
||||
MongoClient._send_message_with_response = \
|
||||
|
@ -114,4 +116,4 @@ def _mongodb_decode_wire_protocol(message):
|
|||
msg = 'invalid bson'
|
||||
return { 'op': op, 'collection': collection_name,
|
||||
'msg_id': msg_id, 'skip': skip, 'limit': limit,
|
||||
'query': msg }
|
||||
'query': msg }
|
||||
|
|
Loading…
Add table
Reference in a new issue