Skip to content

Commit 4e66648

Browse files
committed
ref: use Envs for Retrier providing (#62)
1 parent 208c219 commit 4e66648

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

deploy/dev/docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ services:
4141
TTT_MATCHMAKING_WORKER_CREATION_INTERVAL_SECONDS: 0.5
4242

4343
TTT_AUTO_CANCEL_INVITATIONS_TO_GAME_INTERVAL_SECONDS: 1
44+
45+
TTT_SERIALIZATION_ERROR_MAX_RETRIES: 10
4446
secrets:
4547
- secrets
4648
command: ttt-dev

deploy/prod/docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ services:
4141
TTT_MATCHMAKING_WORKER_CREATION_INTERVAL_SECONDS: 0.5
4242

4343
TTT_AUTO_CANCEL_INVITATIONS_TO_GAME_INTERVAL_SECONDS: 1
44+
45+
TTT_SERIALIZATION_ERROR_MAX_RETRIES: 10
4446
secrets:
4547
- secrets
4648
networks:

src/ttt/infrastructure/pydantic_settings/envs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class Envs(BaseSettings):
2929

3030
auto_cancel_invitations_to_game_interval_seconds: float
3131

32+
serialization_error_max_retries: int
33+
3234
@classmethod
3335
def settings_customise_sources(
3436
cls,

src/ttt/main/common/di.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ def provide_randoms(self) -> Randoms:
350350
)
351351

352352
@provide(scope=Scope.REQUEST)
353-
def provide_retrier(self) -> Retrier:
354-
return Retrier(_max_retries_map={SerializationError: 10})
353+
def provide_retrier(self, envs: Envs) -> Retrier:
354+
return Retrier(_max_retries_map={
355+
SerializationError: envs.serialization_error_max_retries,
356+
})
355357

356358
provide_retry = provide(RetrierRetry, provides=Retry, scope=Scope.REQUEST)

0 commit comments

Comments
 (0)