Skip to content

Commit

Permalink
hotfix: who would have though that sync.RWMutex isn't automatically u…
Browse files Browse the repository at this point in the history
…pgraded to read-write
  • Loading branch information
kamaln7 committed Jul 22, 2017
1 parent deec09e commit 9134c46
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ karmabot is a Slack bot that listens for and performs karma operations (aka upvo
### Build from Source

1. clone the repo:
1. `git clone -b v1.4.0 https://github.com/kamaln7/karmabot.git`
1. `git clone -b v1.4.1 https://github.com/kamaln7/karmabot.git`
2. run `go get` and then `go build` in `/cmd/karmabot` and `/cmd/karmabotctl`
1. `cd karmabot`
2. `go get`
Expand Down
4 changes: 4 additions & 0 deletions ui/webui/auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,13 @@ func (a *Authenticator) ExpireClients() {
a.clientsMutex.RLock()
for i, client := range a.authedClients {
if now.Sub(client.Added).Hours() >= 48 {
a.clientsMutex.RUnlock()
a.clientsMutex.Lock()

a.authedClients = append(a.authedClients[:i], a.authedClients[i+1:]...)

a.clientsMutex.Unlock()
a.clientsMutex.RLock()
}
}
a.clientsMutex.RUnlock()
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package karmabot

// Version is the current version of karmabot.
const Version = "1.4.0"
const Version = "1.4.1"

0 comments on commit 9134c46

Please sign in to comment.