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
|
@staticmethod
|
||||||
def sever_crashed(server_id):
|
def sever_crashed(server_id):
|
||||||
HelperServerStats.select_database(server_id)
|
HelperServerStats.select_database(server_id)
|
||||||
with database_stats_proxy.atomic():
|
|
||||||
ServerStats.update(crashed=True).where(
|
ServerStats.update(crashed=True).where(
|
||||||
ServerStats.server_id == server_id
|
ServerStats.server_id == server_id
|
||||||
).execute()
|
).execute()
|
||||||
@ -219,7 +218,6 @@ class HelperServerStats:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def set_download(server_id):
|
def set_download(server_id):
|
||||||
HelperServerStats.select_database(server_id)
|
HelperServerStats.select_database(server_id)
|
||||||
with database_stats_proxy.atomic():
|
|
||||||
ServerStats.update(downloading=True).where(
|
ServerStats.update(downloading=True).where(
|
||||||
ServerStats.server_id == server_id
|
ServerStats.server_id == server_id
|
||||||
).execute()
|
).execute()
|
||||||
@ -227,7 +225,6 @@ class HelperServerStats:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def finish_download(server_id):
|
def finish_download(server_id):
|
||||||
HelperServerStats.select_database(server_id)
|
HelperServerStats.select_database(server_id)
|
||||||
with database_stats_proxy.atomic():
|
|
||||||
ServerStats.update(downloading=False).where(
|
ServerStats.update(downloading=False).where(
|
||||||
ServerStats.server_id == server_id
|
ServerStats.server_id == server_id
|
||||||
).execute()
|
).execute()
|
||||||
@ -246,7 +243,6 @@ class HelperServerStats:
|
|||||||
return
|
return
|
||||||
|
|
||||||
HelperServerStats.select_database(server_id)
|
HelperServerStats.select_database(server_id)
|
||||||
with database_stats_proxy.atomic():
|
|
||||||
ServerStats.update(crashed=False).where(
|
ServerStats.update(crashed=False).where(
|
||||||
ServerStats.server_id == server_id
|
ServerStats.server_id == server_id
|
||||||
).execute()
|
).execute()
|
||||||
@ -272,7 +268,6 @@ class HelperServerStats:
|
|||||||
ServerStats.select().where(ServerStats.server_id == server_id)
|
ServerStats.select().where(ServerStats.server_id == server_id)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logger.error(f"Database entry not found! {ex}")
|
logger.error(f"Database entry not found! {ex}")
|
||||||
with database_stats_proxy.atomic():
|
|
||||||
ServerStats.update(updating=value).where(
|
ServerStats.update(updating=value).where(
|
||||||
ServerStats.server_id == server_id
|
ServerStats.server_id == server_id
|
||||||
).execute()
|
).execute()
|
||||||
@ -295,7 +290,6 @@ class HelperServerStats:
|
|||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logger.error(f"Database entry not found! {ex}")
|
logger.error(f"Database entry not found! {ex}")
|
||||||
return
|
return
|
||||||
with database_stats_proxy.atomic():
|
|
||||||
ServerStats.update(first_run=False).where(
|
ServerStats.update(first_run=False).where(
|
||||||
ServerStats.server_id == server_id
|
ServerStats.server_id == server_id
|
||||||
).execute()
|
).execute()
|
||||||
@ -341,7 +335,6 @@ class HelperServerStats:
|
|||||||
ServerStats.select().where(ServerStats.server_id == server_id)
|
ServerStats.select().where(ServerStats.server_id == server_id)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logger.error(f"Database entry not found! {ex}")
|
logger.error(f"Database entry not found! {ex}")
|
||||||
with database_stats_proxy.atomic():
|
|
||||||
ServerStats.update(waiting_start=value).where(
|
ServerStats.update(waiting_start=value).where(
|
||||||
ServerStats.server_id == server_id
|
ServerStats.server_id == server_id
|
||||||
).execute()
|
).execute()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user