From 6e24fdd21d2d7792f4b073ec99b47ed98f0d3dc9 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 139707c4..7dd0a9d5 100644 --- a/health_check/mixins.py +++ b/health_check/mixins.py @@ -84,7 +84,7 @@ def _collect_errors(plugin): _run(plugin) _collect_errors(plugin) else: - with ThreadPoolExecutor(max_workers=len(plugin_instances) or 1) as executor: + with ThreadPoolExecutor() as executor: for plugin in executor.map(_run, plugin_instances): _collect_errors(plugin) return errors