Skip to content

Commit

Permalink
Change health check period based on timeout (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
weiiwang01 committed Sep 19, 2024
1 parent 4e38dd4 commit a5d7e24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ def _wp_install(self):
def _init_pebble_layer(self):
"""Ensure WordPress layer exists in pebble."""
logger.debug("Ensure WordPress layer exists in pebble")
health_check_timeout = self.config.get("health_check_timeout_seconds")
layer = {
"summary": "WordPress layer",
"description": "WordPress server",
Expand All @@ -767,7 +768,8 @@ def _init_pebble_layer(self):
"override": "replace",
"level": "alive",
"http": {"url": "http://localhost"},
"timeout": f"{self.config.get('health_check_timeout_seconds')}s",
"period": f"{max(10, health_check_timeout*2)}s",
"timeout": f"{health_check_timeout}s",
},
},
}
Expand Down

0 comments on commit a5d7e24

Please sign in to comment.