Created
June 29, 2018 14:26
-
-
Save jcushman/ea8adcb37dffdf5c3fdf756d02366ab2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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