speed up loading and saving to redis that the move request are getting a answer when switching workers, strip data that neats to get recomuted every turn
Build and Push Docker Container / build-and-push (push) Successful in 4m49s
Build and Push Docker Container / build-and-push (push) Successful in 4m49s
This commit is contained in:
@@ -151,6 +151,11 @@ class GameBoard:
|
||||
|
||||
return {"name": self.type, "is_ladder": self.is_ladder}
|
||||
|
||||
def __getstate__(self):
|
||||
state = self.__dict__.copy()
|
||||
state['turns'] = [] # strip turn history — grows linearly, not needed for move computation
|
||||
return state
|
||||
|
||||
async def save(self, store_class, **kwargs):
|
||||
store = store_class(**kwargs)
|
||||
await store.save(self)
|
||||
|
||||
Reference in New Issue
Block a user