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
This commit is contained in:
Erik Thuning 2025-02-06 15:43:19 +01:00
parent ae3ea546a2
commit 727d6da1af

@ -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):
"""