|
|
|
@ -35,12 +35,12 @@ class RecentWatcher(Watcher): |
|
|
|
|
def connect(): |
|
|
|
|
logging.debug(f'Live posts client connected') |
|
|
|
|
client.emit('room', f'{board}-manage-recent-hashed' if board else 'globalmanage-recent-hashed') |
|
|
|
|
notify(f'Connected', f'Watching live posts') |
|
|
|
|
#notify(f'Connected', f'Watching live posts') |
|
|
|
|
|
|
|
|
|
@client.event |
|
|
|
|
def disconnect(): |
|
|
|
|
logging.error(f'Live posts client disconnected') |
|
|
|
|
notify(f'Lost live posts connection', f'Retrying in {reconnection_delay} seconds') |
|
|
|
|
#notify(f'Lost live posts connection', f'Retrying in {reconnection_delay} seconds') |
|
|
|
|
|
|
|
|
|
@client.on('newPost') |
|
|
|
|
def on_new_post(post): |
|
|
|
@ -88,7 +88,7 @@ class ReportsWatcher(Watcher): |
|
|
|
|
|
|
|
|
|
except RequestException as e: |
|
|
|
|
logging.error(f'Exception {e} occurred while fetching reports') |
|
|
|
|
self.notify(f'Error while fetching reports', f'Trying to reconnect') |
|
|
|
|
#self.notify(f'Error while fetching reports', f'Trying to reconnect') |
|
|
|
|
|
|
|
|
|
if self._stp.wait(self.fetch_interval): |
|
|
|
|
logging.info("Exiting reports watcher") |
|
|
|
|