Hi,

I'm actually the original author of the WebHooks extension. It was
originally written as more of a prototype, and probably has a few
bugs.

You appear to have hit one. What I believe the problem here is most
likely, is the webhooks extension doesn't unregister its signal
handlers when it shuts down. So, if you were to disable and then
re-enable the extension, it might have the handler registered twice.

If you'd like an example of an extension to work from with a little
more work put into it, check out
https://github.com/reviewboard/ReviewBot

It should have signal handlers that work properly.

On Wed, Dec 4, 2013 at 8:10 AM, Samuel Degrande
<degrande.sam...@orange.fr> wrote:
> Hi all.
>
> I use ReviewBoard 1.7.19, with mod_wsgi.
>
> I'm writing a "rbirker" extension, as a replacement to rbcia.
>
> I used rbwebhooks as an example to write my extension, so mainly
> only the notification code is different: it sends a notification
> to an irker relay through a TCP socket.
>
> But, the signal handler callbacks are called several times for each
> notification (the number of times varying...).
>
> I added some logging to my extension and to the mail notification
> code, and here is an example log of what I get:
>
> 16:34:44 INFO - mail: review_published
> 16:34:44 INFO - mail: sending to .....
> 16:34:44 INFO - irker: review_published
>
> which is fine, but I also sometime get:
>
> 00:10:10 INFO - mail: review_published
> 00:10:10 INFO - mail: sending to .....
> 00:10:10 INFO - irker: review_published
> 00:10:10 INFO - irker: review_published
> 00:10:10 INFO - irker: review_published
> 00:10:10 INFO - irker: review_published
>
> which is not fine.
>
> I also logged the call to the extension __init__ (which connect
> callbacks to signals), and I can see lot of traces:
>
> 19:21:06 INFO - Connecting rbiker
> 19:26:09 INFO - Connecting rbiker
> 19:31:10 INFO - Connecting rbiker
> 19:39:06 INFO - Connecting rbiker
> 19:44:07 INFO - Connecting rbiker
> 19:57:06 INFO - Connecting rbiker
>
> My guess (but I may be totally wrong, I'm a python newbie and I know
> nothing of django) is that the callbacks could be registered several
> times ?
>
> Could someone help me solving that issue ?
>
> Thanks.
>
> --
> Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
> ---
> Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
> ---
> Happy user? Let us know at http://www.reviewboard.org/users/
> --- You received this message because you are subscribed to the Google
> Groups "reviewboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to