Make model *_exists functions way more efficient

This commit is contained in:
luukas
2022-05-16 01:12:03 +03:00
parent 0115421243
commit 65ba65a67d
3 changed files with 3 additions and 9 deletions

View File

@ -205,9 +205,7 @@ class HelperServers:
@staticmethod
def server_id_exists(server_id):
if not HelperServers.get_server_data_by_id(server_id):
return False
return True
return Servers.select().where(Servers.server_id == server_id).count() != 0
@staticmethod
def sever_crashed(server_id):