Skip to main content

autodiscover_tasks

Automatically discovers task modules within a list of packages by searching for a specified related module name, while utilizing a global lock to prevent concurrent execution.

def autodiscover_tasks(
packages: list,
related_name: string = 'tasks'
) - > list

Automatically discovers and imports task modules within a list of packages to register them with the system.

Parameters​

NameTypeDescription
packageslistA collection of package names or paths to search for task modules.
related_namestring = 'tasks'The name of the submodule to look for within each package, typically used to identify task definitions.

Returns​

TypeDescription
listA list of the discovered and imported task modules found within the provided packages.