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

celery beat not working, but celery worker --beat is working, when use database #2059

Closed
xiaods opened this issue May 25, 2014 · 3 comments
Closed

Comments

@xiaods
Copy link

xiaods commented May 25, 2014

Celery 3.1.11

settings.py

# Celery transport
BROKER_URL = 'django://'
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
from celery.schedules import crontab

CELERYBEAT_SCHEDULE = {
        'every-minute': {
            'task': 'tasks.sync_oracle_history',
            'schedule': crontab(minute='*/1'),
            },
        }

in project.apps.proj folder, add a tasks.py

from __future__ import absolute_import
from celery import task

@task(name='tasks.sync_oracle_history')
def sync_oracle_history():
    print "="*30
    print "TODO: sync_oracle_history pending"

no idea, any hints for me is welcome.

in bash shell,when run command: celery beat -A proj -l info, only send to queue, not runing the task,
but change the command celery worker -A proj -l info, the task will trigger.

@ask
Copy link
Contributor

ask commented May 29, 2014

Beat does not execute tasks, it just sends the messages. You need both a beat instance and a worker instance!

@ask ask closed this as completed May 29, 2014
@xiaods
Copy link
Author

xiaods commented May 30, 2014

thanks @ask

@germantellezv
Copy link

Hi, how can i do for don't use those commands every time i want to run the tasks? @xiaods @ask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants