Skip to content

Commit

Permalink
chore(deps): bump github.com/clambin/go-common/cache to v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
clambin committed Aug 26, 2024
1 parent 4699dd3 commit 8b7a761
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.23.0

require (
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874
github.com/clambin/go-common/cache v0.6.0
github.com/clambin/go-common/cache v0.7.0
github.com/clambin/go-common/http v0.5.1
github.com/clambin/go-common/testutils v0.1.0
github.com/coreos/go-oidc/v3 v3.11.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/clambin/go-common/cache v0.6.0 h1:YJr9uEvjcsFHjyxJjXmAG/2YSNcYSseFR964IVrVyS8=
github.com/clambin/go-common/cache v0.6.0/go.mod h1:HqYoCaIq9ckS3xiAQ5y8n3m4GmKSCku2+p/Cli614Sk=
github.com/clambin/go-common/cache v0.7.0 h1:UFBZkDzdLI/QGOg5S+8DzDTtN0dguU+epo21JxDFFkA=
github.com/clambin/go-common/cache v0.7.0/go.mod h1:HqYoCaIq9ckS3xiAQ5y8n3m4GmKSCku2+p/Cli614Sk=
github.com/clambin/go-common/http v0.5.1 h1:TizxJvnpO4OvlTE6s/4YOCQmIglJ93av/pOylhHHYL8=
github.com/clambin/go-common/http v0.5.1/go.mod h1:xf5UqbFEmU0pTvSdVu/LQDyWx6EWoDdIrLOc44NB40E=
github.com/clambin/go-common/testutils v0.1.0 h1:/nGWaOCIhW+Ew1c2NU7GLY/YPb8dp9SV8+MTgWksAgk=
Expand Down
8 changes: 3 additions & 5 deletions pkg/sessions/sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ func (s Sessions) Cookie(session Session, domain string) *http.Cookie {

func (s Sessions) ActiveUsers() map[string]int {
activeUsers := make(map[string]int, s.sessions.Len())
for _, key := range s.sessions.Keys() {
activeSession, _ := s.sessions.Get(key)
for _, activeSession := range s.sessions.Iterate() {
if !activeSession.expired() {
activeUsers[activeSession.Email]++
}
Expand All @@ -90,9 +89,8 @@ func (s Sessions) ActiveUsers() map[string]int {
}

func (s Sessions) Contains(email string) bool {
for _, key := range s.sessions.Keys() {
sess, _ := s.sessions.Get(key)
if sess.Email == email {
for _, session := range s.sessions.Iterate() {
if session.Email == email {
return true
}
}
Expand Down

0 comments on commit 8b7a761

Please # to comment.