Skip to content

Commit

Permalink
#197 more try
Browse files Browse the repository at this point in the history
  • Loading branch information
YanLiang1102 committed Oct 31, 2017
1 parent f434154 commit 7ba90da
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
from pymongo import MongoClient

m pymongo import MongoClient
import pymongo
import pickle
import logging
import time
import logging.config

start_time = time.time()
client1 =MongoClient('mongodb://usr:pswd@portland.cs.ou.edu:port',maxPoolSize=5)
client1 =MongoClient('mongodb://usr:password@portland.cs.ou.edu:port',maxPoolSize=5)
db1 = client1['lexisnexis']
largestory = db1.disk_stories_full
logging.basicConfig(filename='logging.python')

This comment has been minimized.

Copy link
@YanLiang1102

YanLiang1102 Oct 31, 2017

Author Contributor

need to set the logging level either info or debug then when you do logging u do logging.debug or logging.info to be logged.

logging.basicConfig(filename='logging.python',level=logging.DEBUG)
dic = {}
count = 0
dic["errorout"]=0;
Expand Down Expand Up @@ -42,11 +43,13 @@
done=True;
except pymongo.errors.AutoReconnect:
skipon =True
logging.info("Error connecting sleeping for {}".format(pow(2, sleep)))
time.sleep(pow(2, sleep))
logging.debug("Error connecting sleeping for {}".format( sleep))
time.sleep(sleep)
sleep += 1
logging.info("retrying...")
logging.debug("retrying...")

dic["timetaken"]=time.time() - start_time
with open('language_analysis.json', 'w') as fp:
json.dump(dic, fp)


0 comments on commit 7ba90da

Please sign in to comment.