From af99d806c3fb11f08973d8bf9335f4df010c3b5f Mon Sep 17 00:00:00 2001
From: Timothe Jost <timothe.jost@wanadoo.fr>
Date: Wed, 27 Mar 2024 21:30:52 +0100
Subject: [PATCH] test

---
 src/pypelines/__init__.py     |  2 +-
 src/pypelines/celery_tasks.py | 14 +++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/pypelines/__init__.py b/src/pypelines/__init__.py
index b3776cb..fa0af12 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 2f19d98..501fce0 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
-- 
GitLab