I have a extremely strange behaviour with my django q taks.
When i start running a task, all the actions inside the function that is wropped with the async_task – wrapper will be ignored BUT just when set “sync”: False / default. If i set sync: True everything works perfectly (but sync).
Here is my base config:
Q_CLUSTER = {
‘name’: ‘DjangoRedis’,
‘workers’: 1, # one worker will get worked on by time
‘timeout’: 1200,
‘retry’: 1400,
#”recycle”: 500, # ow many tasks each worker should handle before taking a break.
# “cpu_affinity”: 1, requires psutil
“max_attempts”: 4,
“save_limit”: 0,
“guard_cycle”: 1,
#”sync”: False,
#”compress”: True,
#”catch_up”: True, # if sys break catched tasks get restarted -> default true
‘queue_limit’: 70,
‘bulk’: 5,
“poll”: 0.2, # How often to check for new tasks.
‘redis’: {
‘host’: REDIS_PUBLIC_ENDPOINT, #
‘port’: REDIS_PORT,
‘db’: 0,
‘password’: REDIS_DB_PASSWORD,
#’socket_timeout’: None,
}
}
I also ahve prepared a gist file here shows the simplified workflow: https://gist.github.com/wired87/5e64fc79d3aa84cdad87ef7803f508ce
But i think the behaviour must come form somewhere else.
- play around with dj q fields
- checked all tasks djangos admin terminal -> the task is alltimes successfull