diff options
author | guillep2k <18600385+guillep2k@users.noreply.github.com> | 2020-05-04 03:51:09 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 07:51:09 +0100 |
commit | 64029e1468d1c004262088ac7423fac0ba1124b7 (patch) | |
tree | b754c01388c197258fa989fb2a7f23574ad16152 /vendor/gitea.com | |
parent | b7c82cd1a9ce4f863034a3a59312ff9402a8f72c (diff) | |
download | gitea-64029e1468d1c004262088ac7423fac0ba1124b7.tar.gz gitea-64029e1468d1c004262088ac7423fac0ba1124b7.zip |
Update lunny/levelqueue to 0.3.0 (#11285)
Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Diffstat (limited to 'vendor/gitea.com')
-rw-r--r-- | vendor/gitea.com/lunny/levelqueue/go.mod | 3 | ||||
-rw-r--r-- | vendor/gitea.com/lunny/levelqueue/go.sum | 4 | ||||
-rw-r--r-- | vendor/gitea.com/lunny/levelqueue/queue.go | 9 | ||||
-rw-r--r-- | vendor/gitea.com/lunny/levelqueue/set.go | 9 | ||||
-rw-r--r-- | vendor/gitea.com/lunny/levelqueue/uniquequeue.go | 9 |
5 files changed, 30 insertions, 4 deletions
diff --git a/vendor/gitea.com/lunny/levelqueue/go.mod b/vendor/gitea.com/lunny/levelqueue/go.mod index 8b3e56518f..00509b77df 100644 --- a/vendor/gitea.com/lunny/levelqueue/go.mod +++ b/vendor/gitea.com/lunny/levelqueue/go.mod @@ -1,8 +1,9 @@ module gitea.com/lunny/levelqueue require ( + github.com/golang/snappy v0.0.1 // indirect github.com/stretchr/testify v1.3.0 - github.com/syndtr/goleveldb v0.0.0-20190203031304-2f17a3356c66 + github.com/syndtr/goleveldb v1.0.0 ) go 1.13 diff --git a/vendor/gitea.com/lunny/levelqueue/go.sum b/vendor/gitea.com/lunny/levelqueue/go.sum index 7ae1873381..b0d27906a6 100644 --- a/vendor/gitea.com/lunny/levelqueue/go.sum +++ b/vendor/gitea.com/lunny/levelqueue/go.sum @@ -6,6 +6,8 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -20,6 +22,8 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/syndtr/goleveldb v0.0.0-20190203031304-2f17a3356c66 h1:AwmkkZT+TucFotNCL+aNJ/0KCMsRtlXN9fs8uoOMSRk= github.com/syndtr/goleveldb v0.0.0-20190203031304-2f17a3356c66/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= +github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= +github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= diff --git a/vendor/gitea.com/lunny/levelqueue/queue.go b/vendor/gitea.com/lunny/levelqueue/queue.go index 20ed90100c..0570cc572d 100644 --- a/vendor/gitea.com/lunny/levelqueue/queue.go +++ b/vendor/gitea.com/lunny/levelqueue/queue.go @@ -10,6 +10,7 @@ import ( "sync" "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/errors" ) const ( @@ -36,7 +37,13 @@ type Queue struct { func Open(dataDir string) (*Queue, error) { db, err := leveldb.OpenFile(dataDir, nil) if err != nil { - return nil, err + if !errors.IsCorrupted(err) { + return nil, err + } + db, err = leveldb.RecoverFile(dataDir, nil) + if err != nil { + return nil, err + } } return NewQueue(db, []byte{}, true) } diff --git a/vendor/gitea.com/lunny/levelqueue/set.go b/vendor/gitea.com/lunny/levelqueue/set.go index 88f4e9b1d1..f5995cb8f1 100644 --- a/vendor/gitea.com/lunny/levelqueue/set.go +++ b/vendor/gitea.com/lunny/levelqueue/set.go @@ -8,6 +8,7 @@ import ( "sync" "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/util" ) @@ -28,7 +29,13 @@ type Set struct { func OpenSet(dataDir string) (*Set, error) { db, err := leveldb.OpenFile(dataDir, nil) if err != nil { - return nil, err + if !errors.IsCorrupted(err) { + return nil, err + } + db, err = leveldb.RecoverFile(dataDir, nil) + if err != nil { + return nil, err + } } return NewSet(db, []byte(setPrefixStr), true) } diff --git a/vendor/gitea.com/lunny/levelqueue/uniquequeue.go b/vendor/gitea.com/lunny/levelqueue/uniquequeue.go index 8d2676b0d2..a53abb2c4e 100644 --- a/vendor/gitea.com/lunny/levelqueue/uniquequeue.go +++ b/vendor/gitea.com/lunny/levelqueue/uniquequeue.go @@ -8,6 +8,7 @@ import ( "fmt" "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/errors" ) const ( @@ -27,7 +28,13 @@ type UniqueQueue struct { func OpenUnique(dataDir string) (*UniqueQueue, error) { db, err := leveldb.OpenFile(dataDir, nil) if err != nil { - return nil, err + if !errors.IsCorrupted(err) { + return nil, err + } + db, err = leveldb.RecoverFile(dataDir, nil) + if err != nil { + return nil, err + } } return NewUniqueQueue(db, []byte{}, []byte(uniqueQueuePrefixStr), true) } |