Fix bug with motd crashing stats

This commit is contained in:
Andrew 2022-01-25 21:40:34 -05:00
parent 35334f010b
commit 32852c00b9
2 changed files with 3 additions and 6 deletions

View File

@ -453,7 +453,7 @@ class TasksManager:
'players': srv['raw_ping_result'].get('players'),
'desc': srv['raw_ping_result'].get('desc'),
'version': srv['raw_ping_result'].get('version'),
'icon': srv['raw_ping_result'].get('icon')
'icon': None
})
if len(websocket_helper.clients) > 0:
websocket_helper.broadcast_user_page_params(
@ -478,7 +478,7 @@ class TasksManager:
'players': srv['raw_ping_result'].get('players'),
'desc': srv['raw_ping_result'].get('desc'),
'version': srv['raw_ping_result'].get('version'),
'icon': srv['raw_ping_result'].get('icon')
'icon': None
}
)

View File

@ -77,10 +77,7 @@ class WebSocketHelper:
def broadcast_with_fn(self, filter_fn, event_type: str, data):
clients = list(filter(filter_fn, self.clients))
try:
logger.debug(f"Sending to {len(clients)} out of {len(self.clients)} clients: {json.dumps({'event': event_type, 'data': data})}")
except:
logger.debug("Our logging statement actually just farted line 83 websocket helper.")
logger.debug(f"Sending to {len(clients)} out of {len(self.clients)} clients: {json.dumps({'event': event_type, 'data': data})}")
for client in clients:
try: