Kuba Stach
Kuba Stach

Reputation: 23

Celery Task not working

every time I try to use delay() nothing happens.

from celery import Celery

app = Celery('tasks', broker='redis://localhost:6379')

@app.task
def run(msg):
    print(msg)

word="xxx"
run.delay(word)

I checked redis with ping and it seems to be working. Or maybe I should use something different to run background threads in Flask app?

Upvotes: 1

Views: 7599

Answers (1)

kkiat
kkiat

Reputation: 571

You need to start worker in order to pick up the task to process.

http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html#id9

Upvotes: 1

Related Questions