mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 01:35:28 +01:00
Fix error where database atomic is not needed
This commit is contained in:
parent
2709ebb54b
commit
f099639cc6
@ -211,7 +211,6 @@ class HelperServerStats:
|
||||
@staticmethod
|
||||
def sever_crashed(server_id):
|
||||
HelperServerStats.select_database(server_id)
|
||||
with database_stats_proxy.atomic():
|
||||
ServerStats.update(crashed=True).where(
|
||||
ServerStats.server_id == server_id
|
||||
).execute()
|
||||
@ -219,7 +218,6 @@ class HelperServerStats:
|
||||
@staticmethod
|
||||
def set_download(server_id):
|
||||
HelperServerStats.select_database(server_id)
|
||||
with database_stats_proxy.atomic():
|
||||
ServerStats.update(downloading=True).where(
|
||||
ServerStats.server_id == server_id
|
||||
).execute()
|
||||
@ -227,7 +225,6 @@ class HelperServerStats:
|
||||
@staticmethod
|
||||
def finish_download(server_id):
|
||||
HelperServerStats.select_database(server_id)
|
||||
with database_stats_proxy.atomic():
|
||||
ServerStats.update(downloading=False).where(
|
||||
ServerStats.server_id == server_id
|
||||
).execute()
|
||||
@ -246,7 +243,6 @@ class HelperServerStats:
|
||||
return
|
||||
|
||||
HelperServerStats.select_database(server_id)
|
||||
with database_stats_proxy.atomic():
|
||||
ServerStats.update(crashed=False).where(
|
||||
ServerStats.server_id == server_id
|
||||
).execute()
|
||||
@ -272,7 +268,6 @@ class HelperServerStats:
|
||||
ServerStats.select().where(ServerStats.server_id == server_id)
|
||||
except Exception as ex:
|
||||
logger.error(f"Database entry not found! {ex}")
|
||||
with database_stats_proxy.atomic():
|
||||
ServerStats.update(updating=value).where(
|
||||
ServerStats.server_id == server_id
|
||||
).execute()
|
||||
@ -295,7 +290,6 @@ class HelperServerStats:
|
||||
except Exception as ex:
|
||||
logger.error(f"Database entry not found! {ex}")
|
||||
return
|
||||
with database_stats_proxy.atomic():
|
||||
ServerStats.update(first_run=False).where(
|
||||
ServerStats.server_id == server_id
|
||||
).execute()
|
||||
@ -341,7 +335,6 @@ class HelperServerStats:
|
||||
ServerStats.select().where(ServerStats.server_id == server_id)
|
||||
except Exception as ex:
|
||||
logger.error(f"Database entry not found! {ex}")
|
||||
with database_stats_proxy.atomic():
|
||||
ServerStats.update(waiting_start=value).where(
|
||||
ServerStats.server_id == server_id
|
||||
).execute()
|
||||
|
Loading…
x
Reference in New Issue
Block a user