Skip to content

Commit e7b046c

Browse files
committed
[update] crawl/lib_mongo_atlas.py
1 parent 89dcba0 commit e7b046c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

crawl/lib_mongo_atlas.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,20 @@ def mongodb_conn(json_data, opt_verbose='OFF'):
2121
logger.info(msg.format(conn_url))
2222

2323
try:
24-
client=MongoClient(conn_url, connectTimeoutMS=5000, socketTimeoutMS=5000)
24+
client=MongoClient(conn_url)
2525
db=client[json_data["db"]]
2626
coll=db[json_data["collection"]]
2727
#db = client.test
2828
print("connected successfully!!")
2929

30-
return client, db, coll
30+
return db, coll
3131
except:
3232
print("Sorry!connection failed!!")
3333
'''
3434
MongoDB insertMany and skip duplicates
3535
https://stackoverflow.com/questions/61480444/mongodb-insertmany-and-skip-duplicates
3636
'''
3737
def mongodb_insert_many(db, coll, list_collections, ordered= True, opt_verbose='OFF'):
38-
msg = '\n insert collections: {} to DB'
39-
logger.info(msg.format(len(list_collections) ))
4038

4139
if opt_verbose.lower() == 'on':
4240
msg = '\n list_collections: {}'

0 commit comments

Comments
 (0)