add code to reconnect to database if connection is gettring broken or database getting a reboot

This commit is contained in:
2025-03-08 11:32:19 +01:00
parent 4b51ddc84d
commit 31d2e7ea55
3 changed files with 26 additions and 6 deletions
+2
View File
@@ -138,6 +138,8 @@ class Server:
game_board.save(
StorageLoader.build(self.storage_type),
file_path=os.path.join(self.data_path, 'data'),
database=os.getenv("EDGEDB_DATABASE", None),
tls_security=None
)
print("GAME ENDED: Winner is", [ x["name"] for x in game_state["board"]['snakes']])