diff --git a/src/pypelines/__init__.py b/src/pypelines/__init__.py index b3776cb4435c9f7f8c4e115553c637b335b3316b..fa0af12f2aac6334d791bdc2fb0af9e31500cd3f 100644 --- a/src/pypelines/__init__.py +++ b/src/pypelines/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.0.35" +__version__ = "0.0.36" from . import loggs from .pipes import * diff --git a/src/pypelines/celery_tasks.py b/src/pypelines/celery_tasks.py index 2f19d9864251f116aee683e3a936e9b3f6b76048..501fce0359866b66a0293ce0575733ec8045eda9 100644 --- a/src/pypelines/celery_tasks.py +++ b/src/pypelines/celery_tasks.py @@ -280,7 +280,7 @@ class LogTask: self.logger.removeHandler(self.logger.handlers[-1]) -def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery": +def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery | None": failure_message = ( f"Celery app : {app_name} failed to be created." @@ -350,10 +350,14 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery": APPLICATIONS_STORE[app_name] = app - app.register_task(handshake) + from celery import Task - return app + class handshake(Task): + name = "handshake" + def run(self): + return f"{node()} is happy to shake your hand and says hello !" -def handshake(): - return f"{node()} is happy to shake your hand and says hello !" + app.register_task(handshake) + + return app