Closed jimydavis closed 9 months ago
You are right, that is a case that did not arose before the hooks implementation was moved to a public package. I will add some documentation saying if NewHandlerWithHooks
is used, the notification channels must not be used anymore.
pre-create
andpost-create
handler.CreatedUploads
like below:What then happened was the code in
hooks/hooks.go
had a race condition on consuming thehandler.CreatedUploads
channel.Effectively, sometimes the
post-create
hook was notified and sometimes it was not. After I removed my own monitoring code that was consuming the channel, everything worked as intended. Since this config is public, a user wouldn't know that there might be such a race condition.Am I interpreting this correctly?
If this is indeed an issue, a suggested solution is that of: