arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
Replace github.com/marusama/semaphore by golang.org/x/sync
Eduard S eduard@iden3.io
Mon, 15 Feb 2021 13:08:43 +0100
commit

729966f85482d80915bd47c68eabe6a218a264e2

parent

1c10a01cf718715700a6850853660aa2643cfaf7

3 files changed, 4 insertions(+), 7 deletions(-)

jump to
M db/utils.go → db/utils.go

@@ -13,9 +13,9 @@ "github.com/gobuffalo/packr/v2"

"github.com/hermeznetwork/hermez-node/log" "github.com/hermeznetwork/tracerr" "github.com/jmoiron/sqlx" - "github.com/marusama/semaphore/v2" migrate "github.com/rubenv/sql-migrate" "github.com/russross/meddler" + "golang.org/x/sync/semaphore" ) var migrations *migrate.PackrMigrationSource

@@ -89,14 +89,14 @@ }

// APIConnectionController is used to limit the SQL open connections used by the API type APIConnectionController struct { - smphr semaphore.Semaphore + smphr *semaphore.Weighted timeout time.Duration } // NewAPICnnectionController initialize APIConnectionController func NewAPICnnectionController(maxConnections int, timeout time.Duration) *APIConnectionController { return &APIConnectionController{ - smphr: semaphore.New(maxConnections), + smphr: semaphore.NewWeighted(int64(maxConnections)), timeout: timeout, } }
M go.mod → go.mod

@@ -17,7 +17,6 @@ github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a

github.com/jmoiron/sqlx v1.2.1-0.20200615141059-0794cb1f47ee github.com/joho/godotenv v1.3.0 github.com/lib/pq v1.8.0 - github.com/marusama/semaphore/v2 v2.4.1 github.com/mattn/go-sqlite3 v2.0.3+incompatible github.com/miguelmota/go-ethereum-hdwallet v0.0.0-20200123000308-a60dcd172b4c github.com/mitchellh/copystructure v1.0.0

@@ -29,5 +28,6 @@ github.com/urfave/cli/v2 v2.2.0

go.uber.org/zap v1.16.0 golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 golang.org/x/net v0.0.0-20200822124328-c89045814202 + golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 gopkg.in/go-playground/validator.v9 v9.29.1 )
M go.sum → go.sum

@@ -415,9 +415,6 @@ github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY=

github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/marusama/semaphore v0.0.0-20190110074507-6952cef993b2 h1:sq+a5mb8zHbmHhrIH06oqIMGsanjpbxNgxEgZVfgpvQ= -github.com/marusama/semaphore/v2 v2.4.1 h1:Y29DhhFMvreVgoqF9EtaSJAF9t2E7Sk7i5VW81sqB8I= -github.com/marusama/semaphore/v2 v2.4.1/go.mod h1:z9nMiNUekt/LTpTUQdpp+4sJeYqUGpwMHfW0Z8V8fnQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=