Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #44. Use @shared_task decorator #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions recommends/tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from celery.task import task, periodic_task
from celery import shared_task
from celery.task import periodic_task
from celery.schedules import crontab
from .utils import filelock

Expand Down Expand Up @@ -34,7 +35,7 @@ def _recommends_precompute():
recommends_precompute()


@task(name='remove_suggestions')
@shared_task(name='remove_suggestions')
def remove_suggestions(rated_model, object_id):
from django.apps import apps
from recommends.providers import recommendation_registry
Expand All @@ -47,7 +48,7 @@ def remove_suggestions(rated_model, object_id):
provider_instance.storage.remove_recommendations(obj)


@task(name='remove_similarities')
@shared_task(name='remove_similarities')
def remove_similarities(rated_model, object_id):
from django.apps import apps
from recommends.providers import recommendation_registry
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Django>=1.7
celery>=3.0,<5.0
celery>=4.0,<6.0
python-dateutil>=2.1