[WEB-4796] fix: update MongoDB collection check to use 'is not None' for better clarity #7671
This commit is contained in:
parent
4f349807be
commit
489a6e1e94
1 changed files with 1 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ def flush_to_mongo_and_delete(
|
||||||
mongo_archival_failed = False
|
mongo_archival_failed = False
|
||||||
|
|
||||||
# Try to insert into MongoDB if available
|
# Try to insert into MongoDB if available
|
||||||
if mongo_collection and mongo_available:
|
if mongo_collection is not None and mongo_available:
|
||||||
try:
|
try:
|
||||||
mongo_collection.bulk_write([InsertOne(doc) for doc in buffer])
|
mongo_collection.bulk_write([InsertOne(doc) for doc in buffer])
|
||||||
except BulkWriteError as bwe:
|
except BulkWriteError as bwe:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue