From 031b6469e6ae56c3e7dcf39b3e2c65d803efe313 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 5 Dec 2022 12:25:13 +0000 Subject: [PATCH] Use default number of `max_workers` This allows Python to decide what the right number is, based on the number of CPU cores available. --- health_check/mixins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/health_check/mixins.py b/health_check/mixins.py index fefa29e9..7ab030dc 100644 --- a/health_check/mixins.py +++ b/health_check/mixins.py @@ -40,7 +40,7 @@ def _run(plugin): connections.close_all() - with ThreadPoolExecutor(max_workers=len(self.plugins) or 1) as executor: + with ThreadPoolExecutor() as executor: for plugin in executor.map(_run, self.plugins): if plugin.critical_service: if not HEALTH_CHECK["WARNINGS_AS_ERRORS"]: