Skip to content

Commit

Permalink
feat: fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
panteparak committed Dec 13, 2023
1 parent 6e26076 commit 6492741
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions health_check/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _run(plugin):
from django.db import connections

connections.close_all()

def _collect_errors(plugin):
if plugin.critical_service:
if not HEALTH_CHECK["WARNINGS_AS_ERRORS"]:
Expand All @@ -75,15 +75,16 @@ def _collect_errors(plugin):
)
else:
errors.extend(plugin.errors)

plugins = self.filter_plugins(subset=subset)

plugin_instances = plugins.values()

if HEALTH_CHECK["DISABLE_THREADING"]:
for plugin in plugins:
for plugin in plugin_instances:
_run(plugin)
_collect_errors(plugin)
else:
with ThreadPoolExecutor(max_workers=len(plugins) or 1) as executor:
for plugin in executor.map(_run, plugins):
with ThreadPoolExecutor(max_workers=len(plugin_instances) or 1) as executor:
for plugin in executor.map(_run, plugin_instances):
_collect_errors(plugin)
return errors

0 comments on commit 6492741

Please sign in to comment.