python - Celery not carrying out a scheduled, repeating, task -


i'm using django set web-server monitors prices on stock. therefore want task (updating price) occur every 5 seconds, console log telling me update. why won't celery write console asked?

my file structure:

├── project │   ├── celery.py │   ├── __init__.py │   ├── settings.py │   ├── urls.py │   └── wsgi.py ├── manage.py ├── application │   ├── admin.py │   ├── __init__.py │   ├── migrations │   ├── models.py │   ├── serializers.py │   |── tasks.py │   |── tests.py │   |── views.py 

my celery setup in settings.py:

# celery celery_result_backend = 'djcelery.backends.database:databasebackend' celery_task_result_expires = 3600  # celery repeating tasks celerybeat_schedule = {     'notify-every-10-seconds': {          'task': 'main.tasks.update',          'schedule': timedelta(seconds=10),     }, } 

and task itself:

from __future__ import absolute_import  celery import shared_task .models import nasdaqshare   @shared_task def update():     print('updated!') 

when running celery worker network, using django database, appears list application.tasks.update task run.

why not seeing being printed console then?

if you'd more information, let me know.

make sure run celery beat scheduler, e.g. celery -a project beat


Comments