Skip to content

Commit

Permalink
feat: menu celery task
Browse files Browse the repository at this point in the history
  • Loading branch information
fmelihh committed Dec 7, 2024
1 parent dbdc9d6 commit b0702f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/recommendation_engine/app/tasks/comments.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from celery.app.task import Task
from celery.schedules import crontab

from ..shared_kernel.scheduler.celery_app import celery_application
from ..features.comments.services import (
Expand Down Expand Up @@ -45,3 +46,10 @@ def run(self, *args, **kwargs):


celery_application.register_task(CommentTask)


celery_application.conf.beat_schedule[str(CommentTask.__name__)] = {
"task": str(CommentTask.__module__),
"schedule": crontab(hour="12", minute="30"),
"options": {"queue": "periodic"},
}
7 changes: 7 additions & 0 deletions src/recommendation_engine/app/tasks/menu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from celery.app.task import Task
from celery.schedules import crontab

from ..shared_kernel.domain_providers import Providers
from ..features.restaurants.services import RestaurantService
Expand Down Expand Up @@ -42,3 +43,9 @@ def run(self, *args, **kwargs):


celery_application.register_task(MenuTask)

celery_application.conf.beat_schedule[str(MenuTask.__name__)] = {
"task": str(MenuTask.__module__),
"schedule": crontab(hour="12", minute="30"),
"options": {"queue": "periodic"},
}

0 comments on commit b0702f9

Please sign in to comment.