From 727d6da1af6915c17d1a866717a0d8ebb79d3532 Mon Sep 17 00:00:00 2001
From: Erik Thuning <boooink@gmail.com>
Date: Thu, 6 Feb 2025 15:43:19 +0100
Subject: [PATCH] Removed the ability for any handler to use multiple instances
 by default

Now each handler must implement support for multiple instances in its own
implementation of the instantiate() method
---
 pipeline/handlers/handler.py | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/pipeline/handlers/handler.py b/pipeline/handlers/handler.py
index 945ccda..83882c3 100644
--- a/pipeline/handlers/handler.py
+++ b/pipeline/handlers/handler.py
@@ -36,22 +36,20 @@ class Handler(QueueThread, metaclass=ABCMeta):
                     tempdir,
                     config):
         """
-        Factory method to create a number of Handler instances based on the
-        count given in the config for a specific handler.
+        Factory method to create a number of Handler instances based on
+        handler-specific configuration.
 
         Only intended to be called on a subclass.
 
-        Returns a list of at least one instance of the Handler in question.
+        This default implementation returns one instance of the Handler in
+        question (wrapped in a list).
         """
-        instances = []
-        for i in range(config.get('count', 1)):
-            instances.append(cls(handlerqueue,
-                                 collector,
-                                 worker,
-                                 ldap,
-                                 tempdir,
-                                 config))
-        return instances
+        return [cls(handlerqueue,
+                    collector,
+                    worker,
+                    ldap,
+                    tempdir,
+                    config)]
 
     def _process(self, queueitem):
         """