adjust connection rate
This commit is contained in:
parent
0201c904fa
commit
836ae979cb
1 changed files with 3 additions and 1 deletions
|
@ -109,6 +109,7 @@ class ChannelMonitor(threading.Thread):
|
|||
def poll_channel(self, room):
|
||||
try:
|
||||
r = Pnut(app.config['MATRIX_PNUT_TOKEN']).get_channel_stream(room.pnut_chan, room.pnut_since)
|
||||
# print(r.headers['X-RateLimit-Remaining'], r.headers['X-RateLimit-Reset'])
|
||||
except requests.exceptions.ConnectionError:
|
||||
logging.info('*** Problem connecting to pnut.io! Waiting to retry. ***')
|
||||
time.sleep(30)
|
||||
|
@ -187,7 +188,8 @@ class ChannelMonitor(threading.Thread):
|
|||
rooms = MatrixRoom2.query.all()
|
||||
for r in rooms:
|
||||
self.poll_channel(r)
|
||||
time.sleep(15)
|
||||
time.sleep(1)
|
||||
time.sleep(1.5)
|
||||
logging.info("-- Stopping channel monitor --")
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in a new issue