forked from ticketfrei/ticketfrei
CRLF missing in log format, experimenting with twitter api rate limit
This commit is contained in:
parent
b3fa55104c
commit
063d3b7869
|
@ -41,7 +41,7 @@ class RetootBot(object):
|
||||||
message = message + " The traceback is located at " + os.path.join("logs" + time)
|
message = message + " The traceback is located at " + os.path.join("logs" + time)
|
||||||
with open(os.path.join("logs", time), 'w+') as f:
|
with open(os.path.join("logs", time), 'w+') as f:
|
||||||
f.write(tb)
|
f.write(tb)
|
||||||
line = "[" + time + "] "+ message
|
line = "[" + time + "] "+ message + "\n"
|
||||||
with open(self.logpath, 'a') as f:
|
with open(self.logpath, 'a') as f:
|
||||||
f.write(line)
|
f.write(line)
|
||||||
print line
|
print line
|
||||||
|
|
|
@ -85,7 +85,7 @@ class RetweetBot(object):
|
||||||
message = message + " The traceback is located at " + os.path.join("logs" + time)
|
message = message + " The traceback is located at " + os.path.join("logs" + time)
|
||||||
with open(os.path.join("logs", time), 'w+') as f:
|
with open(os.path.join("logs", time), 'w+') as f:
|
||||||
f.write(tb)
|
f.write(tb)
|
||||||
line = "[" + time + "] "+ message
|
line = "[" + time + "] "+ message + "\n"
|
||||||
with open(self.logpath, 'a') as f:
|
with open(self.logpath, 'a') as f:
|
||||||
f.write(line)
|
f.write(line)
|
||||||
print line
|
print line
|
||||||
|
@ -136,7 +136,7 @@ class RetweetBot(object):
|
||||||
return mentions
|
return mentions
|
||||||
except twitter.TwitterError:
|
except twitter.TwitterError:
|
||||||
self.log("Twitter API Error: Rate Limit Exceeded.")
|
self.log("Twitter API Error: Rate Limit Exceeded.")
|
||||||
sleep(60)
|
sleep(120)
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
self.log("Twitter API Error: Bad Connection.")
|
self.log("Twitter API Error: Bad Connection.")
|
||||||
sleep(10)
|
sleep(10)
|
||||||
|
|
Loading…
Reference in a new issue