Skip to content

Commit

Permalink
feat: entity tasks were created
Browse files Browse the repository at this point in the history
  • Loading branch information
fmelihh committed Jul 18, 2024
1 parent e7ba830 commit 77fdb9f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/recommendation_engine/app/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
from .menu import *
from .comments import *
from .restaurant import *
from .data_extraction import *
13 changes: 13 additions & 0 deletions src/recommendation_engine/app/tasks/comments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from celery.app.task import Task

from ..shared_kernel.scheduler.celery_app import celery_application


class CommentTask(Task):
__name__ = "CommentTask"

def run(self, *args, **kwargs):
pass


celery_application.register_task(CommentTask)
11 changes: 10 additions & 1 deletion src/recommendation_engine/app/tasks/data_extraction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import celery
from celery.app.task import Task
from celery.schedules import crontab

Expand All @@ -8,7 +9,15 @@ class DataExtractionTask(Task):
__name__ = "DataExtractionTask"

def run(self, *args, **kwargs):
pass
from .menu import MenuTask
from .comments import CommentTask
from .restaurant import RestaurantTask

menu_task = MenuTask()
comment_task = CommentTask()
restaurant_task = RestaurantTask()

celery.chain(restaurant_task.s(), menu_task.s(), comment_task.s()).apply_async()


celery_application.register_task(DataExtractionTask)
Expand Down
13 changes: 13 additions & 0 deletions src/recommendation_engine/app/tasks/menu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from celery.app.task import Task

from ..shared_kernel.scheduler.celery_app import celery_application


class MenuTask(Task):
__name__ = "MenuTask"

def run(self, *args, **kwargs):
pass


celery_application.register_task(MenuTask)
13 changes: 13 additions & 0 deletions src/recommendation_engine/app/tasks/restaurant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from celery.app.task import Task

from ..shared_kernel.scheduler.celery_app import celery_application


class RestaurantTask(Task):
__name__ = "RestaurantTask"

def run(self, *args, **kwargs):
pass


celery_application.register_task(RestaurantTask)

0 comments on commit 77fdb9f

Please sign in to comment.