attempt to handle connection error to pnut, issue #13
This commit is contained in:
parent
76e1c15b69
commit
0201c904fa
1 changed files with 10 additions and 1 deletions
|
@ -107,7 +107,16 @@ class ChannelMonitor(threading.Thread):
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
def poll_channel(self, room):
|
def poll_channel(self, room):
|
||||||
r = Pnut(app.config['MATRIX_PNUT_TOKEN']).get_channel_stream(room.pnut_chan, room.pnut_since)
|
try:
|
||||||
|
r = Pnut(app.config['MATRIX_PNUT_TOKEN']).get_channel_stream(room.pnut_chan, room.pnut_since)
|
||||||
|
except requests.exceptions.ConnectionError:
|
||||||
|
logging.info('*** Problem connecting to pnut.io! Waiting to retry. ***')
|
||||||
|
time.sleep(30)
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
logging.info('*** Registered some other error! Waiting to retry. ***')
|
||||||
|
time.sleep(30)
|
||||||
|
return
|
||||||
if r is not None and r.status_code == 200:
|
if r is not None and r.status_code == 200:
|
||||||
rdata = r.json()
|
rdata = r.json()
|
||||||
pqueue = []
|
pqueue = []
|
||||||
|
|
Loading…
Reference in a new issue