Skip to content

Commit c616fdb

Browse files
committed
release on return
1 parent d763b21 commit c616fdb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bot/bot.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package bot
22

33
import (
44
"fmt"
5-
"github.com/bivas/rivi/util"
6-
"github.com/patrickmn/go-cache"
75
"net/http"
86
"path/filepath"
97
"strings"
108
"sync"
119
"time"
10+
11+
"github.com/bivas/rivi/util"
12+
"github.com/patrickmn/go-cache"
1213
)
1314

1415
type HandledEventResult struct {
@@ -90,10 +91,12 @@ func (b *bot) HandleEvent(r *http.Request) *HandledEventResult {
9091
b.cacheLocker.Unlock()
9192
workingConfiguration, err := b.getCurrentConfiguration(namespace)
9293
if err != nil {
94+
locker.(*sync.Mutex).Unlock()
9395
return &HandledEventResult{Message: err.Error()}
9496
}
9597
data, process := buildFromRequest(workingConfiguration.GetClientConfig(), r)
9698
if !process {
99+
locker.(*sync.Mutex).Unlock()
97100
return &HandledEventResult{Message: "Skipping rules processing (could be not supported event type)"}
98101
}
99102
util.Logger.Debug("release namespace %s lock", namespace)

0 commit comments

Comments
 (0)