Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: run Celery tasks asynchronously in dev mode
In `tutor dev`, Celery tasks were running eagerly (in-process) rather than being delegated to the worker containers for asynchronous processing. This difference in behavior between `tutor dev` and `tutor local` meant that certain code paths and race-condition bugs would not surface when testing in dev. The cause is that CELERY_ALWAYS_EAGER is set to True in the upstream devstack settings file. That's because Devstack does not support async LMS/CMS workers; it runs all those tasks in-process. The fix is to simply override CELERY_ALWAYS_EAGER to False. We do this in the common settings file for simplicity, but the change should not affect production mode, which has always had CELERY_ALWAYS_EAGER equal False. For unit tests, we override CELERY_ALAYS_EAGER back to True, because many of them are written to assume in-process tasks.
- Loading branch information