Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit 0154426

Browse files
Merge pull request #1639 from jonnystoten/use-mysql-index
Ensure index is used when running on MySQL
2 parents d730561 + 3d03977 commit 0154426

File tree

232 files changed

+105148
-133539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+105148
-133539
lines changed

‎go.mod‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,18 @@ require (
1818
github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916 // indirect
1919
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
2020
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b
21-
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
2221
github.com/go-sql-driver/mysql v1.5.0
2322
github.com/gogo/protobuf v1.0.0 // indirect
2423
github.com/golang/protobuf v1.3.4
2524
github.com/google/certificate-transparency-go v1.0.10-0.20180222191210-5ab67e519c93 // indirect
2625
github.com/gorilla/mux v1.7.0
2726
github.com/inconshreveable/mousetrap v1.0.0 // indirect
28-
github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8
29-
github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d // indirect
30-
github.com/jinzhu/now v1.1.1 // indirect
27+
github.com/jinzhu/gorm v1.9.16
28+
github.com/jinzhu/now v1.1.4 // indirect
3129
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 // indirect
3230
github.com/lib/pq v1.9.0
3331
github.com/magiconair/properties v1.5.3 // indirect
34-
github.com/mattn/go-sqlite3 v1.6.0
32+
github.com/mattn/go-sqlite3 v1.14.0
3533
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
3634
github.com/miekg/pkcs11 v1.0.3
3735
github.com/mitchellh/mapstructure v1.0.0 // indirect
@@ -50,8 +48,8 @@ require (
5048
github.com/spf13/viper v0.0.0-20150530192845-be5ff3e4840c
5149
github.com/stretchr/testify v1.5.1
5250
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9
53-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
54-
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e
51+
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
52+
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd
5553
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221
5654
google.golang.org/grpc v1.0.5
5755
gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.1

‎go.sum‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
22
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
3+
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
34
github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d h1:hi6J4K6DKrR4/ljxn6SF6nURyu785wKMuQcjt7H3VCQ=
45
github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
6+
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
57
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
68
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
79
github.com/bitly/go-hostpool v0.1.0 h1:XKmsF6k5el6xHG3WPJ8U0Ku/ye7njX7W81Ng7O2ioR0=
@@ -22,6 +24,7 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
2224
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2325
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2426
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
27+
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
2528
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73 h1:OGNva6WhsKst5OZf7eZOklDztV3hwtTHovdrLHV+MsA=
2629
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
2730
github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
@@ -57,12 +60,13 @@ github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMW
5760
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
5861
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
5962
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
60-
github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8 h1:CZkYfurY6KGhVtlalI4QwQ6T0Cu6iuY3e0x5RLu96WE=
61-
github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo=
62-
github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d h1:jRQLvyVGL+iVtDElaEIDdKwpPqUIZJfzkNLV34htpEc=
63-
github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
64-
github.com/jinzhu/now v1.1.1 h1:g39TucaRWyV3dwDO++eEc6qf8TVIQ/Da48WmqjZ3i7E=
65-
github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
63+
github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o=
64+
github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
65+
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
66+
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
67+
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
68+
github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas=
69+
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
6670
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 h1:UUHMLvzt/31azWTN/ifGWef4WUqvXk0iRqdhdy/2uzI=
6771
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U=
6872
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
@@ -71,12 +75,13 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
7175
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
7276
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
7377
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
78+
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
7479
github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8=
7580
github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
7681
github.com/magiconair/properties v1.5.3 h1:C8fxWnhYyME3n0klPOhVM7PtYUB3eV1W3DeFmN3j53Y=
7782
github.com/magiconair/properties v1.5.3/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
78-
github.com/mattn/go-sqlite3 v1.6.0 h1:TDwTWbeII+88Qy55nWlof0DclgAtI4LqGujkYMzmQII=
79-
github.com/mattn/go-sqlite3 v1.6.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
83+
github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
84+
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
8085
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
8186
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
8287
github.com/miekg/pkcs11 v1.0.3 h1:iMwmD7I5225wv84WxIG/bmxz9AXjWvTWIbM/TYHvWtw=
@@ -130,19 +135,24 @@ github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H
130135
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
131136
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
132137
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
138+
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
133139
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
134140
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o=
135141
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
142+
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
136143
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
137-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
138144
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
145+
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
146+
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
147+
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
139148
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
140149
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
141150
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
142151
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
143152
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
144-
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA=
145153
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
154+
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
155+
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
146156
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM=
147157
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
148158
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=

‎server/storage/concurrent_sqldb_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func init() {
4949
gormDB.Close()
5050
dbStore := SetupSQLDB(t, backend, dburl)
5151
return dbStore, func() {
52-
dropTables(&dbStore.DB)
52+
dropTables(dbStore.DB)
5353
dbStore.Close()
5454
}
5555
}

‎server/storage/sql_models.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (c SQLChange) TableName() string {
4848
}
4949

5050
// CreateTUFTable creates the DB table for TUFFile
51-
func CreateTUFTable(db gorm.DB) error {
51+
func CreateTUFTable(db *gorm.DB) error {
5252
// TODO: gorm
5353
query := db.AutoMigrate(&TUFFile{})
5454
if query.Error != nil {
@@ -60,7 +60,7 @@ func CreateTUFTable(db gorm.DB) error {
6060
}
6161

6262
// CreateChangefeedTable creates the DB table for Changefeed
63-
func CreateChangefeedTable(db gorm.DB) error {
63+
func CreateChangefeedTable(db *gorm.DB) error {
6464
query := db.AutoMigrate(&SQLChange{})
6565
return query.Error
6666
}

‎server/storage/sqldb.go‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
// SQLStorage implements a versioned store using a relational database.
1919
// See server/storage/models.go
2020
type SQLStorage struct {
21-
gorm.DB
21+
*gorm.DB
2222
}
2323

2424
// NewSQLStorage is a convenience method to create a SQLStorage
@@ -28,7 +28,7 @@ func NewSQLStorage(dialect string, args ...interface{}) (*SQLStorage, error) {
2828
return nil, err
2929
}
3030
return &SQLStorage{
31-
DB: *gormDB,
31+
DB: gormDB,
3232
}, nil
3333
}
3434

@@ -63,7 +63,7 @@ func (db *SQLStorage) UpdateCurrent(gun data.GUN, update MetaUpdate) error {
6363
// struct, because that only works with non-zero values, and Version
6464
// can be 0.
6565
exists := db.Where("gun = ? and role = ? and version >= ?",
66-
gun.String(), update.Role.String(), update.Version).First(&TUFFile{})
66+
gun.String(), update.Role.String(), update.Version).Take(&TUFFile{})
6767

6868
if exists.Error == nil {
6969
return ErrOldVersion{}
@@ -144,7 +144,7 @@ func (db *SQLStorage) UpdateMany(gun data.GUN, updates []MetaUpdate) error {
144144
// If there are any files with version equal or higher than the minimum
145145
// version we're trying to insert, bail out now
146146
exists := db.Where("gun = ? and role = ? and version >= ?",
147-
gun.String(), role.String(), minVersion).First(&TUFFile{})
147+
gun.String(), role.String(), minVersion).Take(&TUFFile{})
148148

149149
if exists.Error == nil {
150150
return ErrOldVersion{}
@@ -218,7 +218,7 @@ func (db *SQLStorage) writeChangefeed(tx *gorm.DB, gun data.GUN, version int, ch
218218
func (db *SQLStorage) GetCurrent(gun data.GUN, tufRole data.RoleName) (*time.Time, []byte, error) {
219219
var row TUFFile
220220
q := db.Select("updated_at, data").Where(
221-
&TUFFile{Gun: gun.String(), Role: tufRole.String()}).Order("version desc").Limit(1).First(&row)
221+
&TUFFile{Gun: gun.String(), Role: tufRole.String()}).Order("version desc").Take(&row)
222222
if err := isReadErr(q, row); err != nil {
223223
return nil, nil, err
224224
}
@@ -234,7 +234,7 @@ func (db *SQLStorage) GetChecksum(gun data.GUN, tufRole data.RoleName, checksum
234234
Role: tufRole.String(),
235235
SHA256: checksum,
236236
},
237-
).First(&row)
237+
).Take(&row)
238238
if err := isReadErr(q, row); err != nil {
239239
return nil, nil, err
240240
}
@@ -250,7 +250,7 @@ func (db *SQLStorage) GetVersion(gun data.GUN, tufRole data.RoleName, version in
250250
Role: tufRole.String(),
251251
Version: version,
252252
},
253-
).First(&row)
253+
).Take(&row)
254254
if err := isReadErr(q, row); err != nil {
255255
return nil, nil, err
256256
}
@@ -295,7 +295,13 @@ func (db *SQLStorage) Delete(gun data.GUN) error {
295295
}
296296

297297
// CheckHealth asserts that the tuf_files table is present
298-
func (db *SQLStorage) CheckHealth() error {
298+
func (db *SQLStorage) CheckHealth() (err error) {
299+
defer func() {
300+
if r := recover(); r != nil {
301+
err = fmt.Errorf("Panic checking db health: %v", r)
302+
}
303+
}()
304+
299305
tableOk := db.HasTable(&TUFFile{})
300306
if db.Error != nil {
301307
return db.Error
@@ -311,7 +317,7 @@ func (db *SQLStorage) CheckHealth() error {
311317
func (db *SQLStorage) GetChanges(changeID string, records int, filterName string) ([]Change, error) {
312318
var (
313319
changes []Change
314-
query = &db.DB
320+
query = db.DB
315321
id int64
316322
err error
317323
)

‎server/storage/sqldb_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type sqldbSetupFunc func(*testing.T) (*SQLStorage, func())
3535

3636
var sqldbSetup sqldbSetupFunc
3737

38-
func assertExpectedGormTUFMeta(t *testing.T, expected []StoredTUFMeta, gormDB gorm.DB) {
38+
func assertExpectedGormTUFMeta(t *testing.T, expected []StoredTUFMeta, gormDB *gorm.DB) {
3939
expectedGorm := make([]TUFFile, len(expected))
4040
for i, tufObj := range expected {
4141
expectedGorm[i] = TUFFile{

‎signer/keydbstore/sql_keydbstore.go‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,13 @@ func (s *SQLKeyDBStore) GetKey(keyID string) data.PublicKey {
229229
}
230230

231231
// HealthCheck verifies that DB exists and is query-able
232-
func (s *SQLKeyDBStore) HealthCheck() error {
232+
func (s *SQLKeyDBStore) HealthCheck() (err error) {
233+
defer func() {
234+
if r := recover(); r != nil {
235+
err = fmt.Errorf("Panic checking db health: %v", r)
236+
}
237+
}()
238+
233239
dbPrivateKey := GormPrivateKey{}
234240
tableOk := s.db.HasTable(&dbPrivateKey)
235241
switch {

‎vendor/github.com/jinzhu/gorm/.codeclimate.yml‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎vendor/github.com/jinzhu/gorm/.gitignore‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎vendor/github.com/jinzhu/gorm/CONTRIBUTING.md‎

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)