Skip to content

Instantly share code, notes, and snippets.

@jcushman
Created June 29, 2018 14:26
Show Gist options
  • Save jcushman/ea8adcb37dffdf5c3fdf756d02366ab2 to your computer and use it in GitHub Desktop.
Save jcushman/ea8adcb37dffdf5c3fdf756d02366ab2 to your computer and use it in GitHub Desktop.
"""Celery master is too aggressive about suppressing .get() in eager tasks.
test performs no synchronous operations, but fails in eager application::
python minimal_eager_chord.py shell --config=minimal_eager_chord
test.delay().get()
"""
import celery
from celery.canvas import chord
app = celery.Celery()
CELERY_RESULT_BACKEND = "redis://localhost/0"
CELERY_ALWAYS_EAGER = True
@app.task()
def a():
return 42
@app.task()
def b(ar):
return ar
@app.task()
def test():
chord(
a.s(), b.s()
).apply_async()
def main():
app.start()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment