Skip to content

Commit caae699

Browse files
committed
api/auth: fix invalid mgo session
This patch updates the outdated mgo package to the community version github.com/globalsign/mgo to fix the issue that the mgo session cannot be used after the primary node shutdown and re-elected. Related issue: globalsign/mgo#5
1 parent 6858bd3 commit caae699

File tree

7 files changed

+81
-21
lines changed

7 files changed

+81
-21
lines changed

controllers/controller-factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import (
66

77
"github.com/twreporter/go-api/internal/news"
88

9+
"github.com/globalsign/mgo"
910
"github.com/jinzhu/gorm"
1011
"github.com/twreporter/go-api/globals"
1112
"github.com/twreporter/go-api/services"
1213
"github.com/twreporter/go-api/storage"
1314
"github.com/twreporter/go-api/utils"
1415
"go.mongodb.org/mongo-driver/mongo"
15-
"gopkg.in/mgo.v2"
1616
)
1717

1818
// ControllerFactory generates controlloers by given persistent storage connection

go.mod

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ go 1.12
44

55
require (
66
cloud.google.com/go v0.52.0 // indirect
7-
github.com/algolia/algoliasearch-client-go v2.25.0+incompatible
87
github.com/algolia/algoliasearch-client-go/v3 v3.16.0
98
github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7
109
github.com/aws/aws-sdk-go v1.34.28
@@ -13,45 +12,51 @@ require (
1312
github.com/dgrijalva/jwt-go v3.2.0+incompatible
1413
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
1514
github.com/gin-contrib/cors v0.0.0-20170708080947-567de1916927
16-
github.com/gin-contrib/sessions v0.0.0-20180827025425-58cbcf30135c
17-
github.com/gin-gonic/gin v1.5.0
15+
github.com/gin-contrib/sessions v0.0.3
16+
github.com/gin-gonic/gin v1.7.2
17+
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
1818
github.com/go-playground/universal-translator v0.17.0 // indirect
19+
github.com/go-playground/validator/v10 v10.7.0 // indirect
1920
github.com/go-sql-driver/mysql v1.5.0
2021
github.com/gofrs/uuid v3.2.0+incompatible // indirect
2122
github.com/golang-migrate/migrate/v4 v4.6.1
23+
github.com/golang/protobuf v1.5.2 // indirect
2224
github.com/google/uuid v1.1.1
2325
github.com/gorilla/mux v1.7.2 // indirect
24-
github.com/gorilla/sessions v1.1.1 // indirect
26+
github.com/gorilla/sessions v1.2.1 // indirect
2527
github.com/jinzhu/copier v0.0.0-20180308034124-7e38e58719c3
2628
github.com/jinzhu/gorm v1.9.2
2729
github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d // indirect
2830
github.com/jinzhu/now v1.0.1 // indirect
29-
github.com/json-iterator/go v1.1.9 // indirect
30-
github.com/kidstuff/mongostore v0.0.0-20180412085134-db2a8b4fac1f // indirect
31+
github.com/json-iterator/go v1.1.11 // indirect
3132
github.com/kr/pretty v0.2.0 // indirect
32-
github.com/leodido/go-urn v1.2.0 // indirect
33+
github.com/leodido/go-urn v1.2.1 // indirect
3334
github.com/lib/pq v1.1.1 // indirect
3435
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2 // indirect
35-
github.com/mattn/go-isatty v0.0.12 // indirect
36+
github.com/mattn/go-isatty v0.0.13 // indirect
3637
github.com/pkg/errors v0.9.1
3738
github.com/sirupsen/logrus v1.4.2
3839
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a // indirect
3940
github.com/spf13/viper v1.3.2
4041
github.com/stretchr/testify v1.6.1
4142
github.com/twreporter/logformatter v0.0.0-20200211094126-60fe42618206
43+
github.com/ugorji/go v1.2.6 // indirect
4244
go.mongodb.org/mongo-driver v1.4.6
43-
golang.org/x/crypto v0.0.0-20200210222208-86ce3cb69678
45+
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
4446
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
45-
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 // indirect
47+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
48+
golang.org/x/text v0.3.6 // indirect
4649
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
4750
google.golang.org/genproto v0.0.0-20200211035748-55294c81d784 // indirect
4851
google.golang.org/grpc v1.27.1 // indirect
52+
google.golang.org/protobuf v1.27.1 // indirect
4953
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
5054
gopkg.in/go-playground/validator.v8 v8.18.2
5155
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
5256
gopkg.in/guregu/null.v3 v3.4.0
5357
gopkg.in/matryer/try.v1 v1.0.0-20150601225556-312d2599e12e
54-
gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528
58+
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
59+
gopkg.in/yaml.v2 v2.4.0 // indirect
5560
)
5661

5762
replace (

0 commit comments

Comments
 (0)