mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-09 08:58:11 +08:00
adds global sync configuration option
Setting the `sync` configuration option will force all async() calls to be run with `sync=True`. Useful for testing.
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ def async(func, *args, **kwargs):
|
||||
task['save'] = save
|
||||
# sign it
|
||||
pack = signing.SignedPackage.dumps(task)
|
||||
if sync:
|
||||
if sync or Conf.SYNC:
|
||||
return _sync(pack)
|
||||
# push it
|
||||
redis.rpush(list_key, pack)
|
||||
|
||||
Reference in New Issue
Block a user