diff --git a/nodescraper/pluginexecutor.py b/nodescraper/pluginexecutor.py index ed5374d..b185823 100644 --- a/nodescraper/pluginexecutor.py +++ b/nodescraper/pluginexecutor.py @@ -194,8 +194,6 @@ def run_queue(self) -> list[PluginResult]: self.logger.exception("Unexpected exception running plugin queue: %s", str(e)) finally: self.logger.info("Closing connections") - for connection_manager in self.connection_library.values(): - connection_manager.disconnect() if self.plugin_config.result_collators: self.logger.info("Running result collators") @@ -217,6 +215,8 @@ def run_queue(self) -> list[PluginResult]: ], **collator_args, ) + for connection_manager in self.connection_library.values(): + connection_manager.disconnect() return plugin_results