当您将参数((status_id))
传递给函数success()时,如何忽略允许[True,False]的参数?
status_id=11
callback = success.subtask((status_id,))
chord(results)(callback)
@app.task(routing_key="message_status", queue="message_status")
def success(status_id):
try:
global db
db = connection()
db.query(MessageTask).filter_by(id=status_id).update({
'status': 'success',
'date': datetime.now().strftime("%Y-%m-%d %H:%M:%S")
})
db.commit()
return True
except Exception as e:
print(e)
status_id来自[[True,False],'11']的结果。如何删除它们?