I tried to add a task_success signal to task scan. But the handler < monitor > did not called after scan executed succeed. I do not know why?
The code is as following shown
logger.info('scan text %s', text)
return re.search(pattern, text).group()
def monitor(sender, **kwargs):
logger.info('task scan completed - %s', kwargs['result'])
I have inspected the internal of signal. And found that the signal module maintains a dict of <look up key, receiver>. The look up key is consisting of id(receiver), id(sender).
Here are related log, the first block is the signal module records the receiver [ Here, it is monitor]. Notice that the id of sender is 62589472
Worker-1 3304 Append receivers - look up key: <(62608664L, 62589472L)>,
sender: << <at> <at> task: proj.text.tasks.scan of WAETask:0x3d10828>task: proj.text.tasks.scan of WAETask:0x3bb0828>>,
receiver: <<weakref at 0000000003BB7548; to 'function' at 0000000003BB5518 (monitor)>>
The second block record the sender id during the execution of celery.utils.dispatch.signal.Signal.send()
Worker-1 3304 - Sender is << <at> task: proj.text.tasks.scan of WAETask:0x3b8ad68>>
Worker-1 3304 - Sender id is <62655008>
The ids of sender are different, 62589472 and 62655008 It looks that there are two instance of the sender, 'proj.text.tasks.scan'.
Why does this happened?
transport: amqp://guest:** <at> localhost:5679//
concurrency: 4 (prefork)
You received this message because you are subscribed to the Google Groups "celery-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to