Skip to content

Commit

Permalink
Use constant instead of hardcoded number
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ratushnyy committed Nov 27, 2023
1 parent 0845e42 commit 5ffaf86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

USER_CREATING_MAX_ATTEMPTS = 5
USER_CREATION_COOLDOWN = 30

REPLICA_SET_INIT_CHECK_TIMEOUT = 10

def _before_sleep_user_creation(retry_state) -> None:
logger.error(
Expand Down Expand Up @@ -773,7 +773,7 @@ def _initialise_replica_set(self, event: StartEvent) -> None:

# Check replica set status before creating users
while not direct_mongo.client.admin.command("hello")["isWritablePrimary"]:
time.sleep(10)
time.sleep(REPLICA_SET_INIT_CHECK_TIMEOUT)
logger.info("User initialization")

for attempt in Retrying(
Expand Down

0 comments on commit 5ffaf86

Please sign in to comment.