Fix context cancel defer
Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
parent
57128d9016
commit
82253a9558
|
@ -265,6 +265,8 @@ func (s *EventServer) handleEvent() func(w http.ResponseWriter, r *http.Request)
|
|||
}
|
||||
|
||||
go func(n notifier.Interface, e events.Event) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
if err := n.Post(ctx, e); err != nil {
|
||||
maskedErrStr, maskErr := masktoken.MaskTokenFromString(err.Error(), token)
|
||||
if maskErr != nil {
|
||||
|
|
Loading…
Reference in New Issue