Only show server inits to admins

This commit is contained in:
amcmanu3 2023-11-03 16:55:41 -04:00
parent 61c1621cbb
commit 4152e2be69
3 changed files with 3 additions and 2 deletions

View File

@ -173,7 +173,7 @@ class ServersController(metaclass=Singleton):
self.failed_servers = [] self.failed_servers = []
for server in servers: for server in servers:
self.ws.broadcast( self.ws.broadcast_to_admins(
"update", {"message": f"Initializing {server['server_name']}."} "update", {"message": f"Initializing {server['server_name']}."}
) )
server_id = server.get("server_id") server_id = server.get("server_id")

View File

@ -37,7 +37,7 @@ class WebSocketManager(metaclass=Singleton):
def broadcast_to_admins(self, event_type: str, data): def broadcast_to_admins(self, event_type: str, data):
def filter_fn(client): def filter_fn(client):
if client.get_user_id in HelperUsers.get_super_user_list(): if str(client.get_user_id()) in str(HelperUsers.get_super_user_list()):
return True return True
return False return False

View File

@ -195,6 +195,7 @@ if __name__ == "__main__":
# init servers # init servers
logger.info("Initializing all servers defined") logger.info("Initializing all servers defined")
Console.info("Initializing all servers defined") Console.info("Initializing all servers defined")
ws.broadcast("update", {"message": "Initializing Servers"})
controller.servers.init_all_servers() controller.servers.init_all_servers()
def tasks_starter(): def tasks_starter():