Skip to content

Commit

Permalink
Merge pull request #48 from kumparan/feature/get-multi-or-lock
Browse files Browse the repository at this point in the history
feature: get multi or lock
  • Loading branch information
zipzap11 authored Apr 6, 2023
2 parents 7ced24e + 707cf02 commit 9e9a1fa
Show file tree
Hide file tree
Showing 5 changed files with 753 additions and 18 deletions.
8 changes: 5 additions & 3 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (
)

// SafeUnlock safely unlock mutex
func SafeUnlock(mutex *redsync.Mutex) {
if mutex != nil {
_, _ = mutex.Unlock()
func SafeUnlock(mutexes ...*redsync.Mutex) {
for _, m := range mutexes {
if m != nil {
_, _ = m.Unlock()
}
}
}

Expand Down
21 changes: 17 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,34 @@ require (
github.com/hashicorp/go-multierror v1.1.1
github.com/jpillora/backoff v1.0.0
github.com/kumparan/redsync/v4 v4.0.0-20220629071359-52de590a1465
github.com/kumparan/tapao v1.2.0
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.7.5
)

require (
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/cockroachdb/apd v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/getsentry/sentry-go v0.11.0 // indirect
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 // indirect
github.com/go-redsync/redsync/v4 v4.5.1 // indirect
github.com/goodsign/monday v1.0.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/graph-gophers/graphql-go v1.4.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/kumparan/go-utils v1.30.0 // indirect
github.com/leekchan/accounting v0.3.1 // indirect
github.com/microcosm-cc/bluemonday v1.0.19 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/pkg/errors v0.8.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
google.golang.org/protobuf v1.27.1 // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/grpc v1.17.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 9e9a1fa

Please sign in to comment.