Handle queued tasks when working outside request context.
Merge branch 'hotfix/0.21.20' into develop