summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-07-27 23:55:48 +0800
committerGitHub <noreply@github.com>2021-07-27 16:55:48 +0100
commit5b2e2d29ca50ba4c11a44d4f1de18ffcf215ba1b (patch)
tree18e71de2c3336373a642e4b6982ce8296e79ded6
parent4b6370c46d8d75a163e271b3636e48791d4cc641 (diff)
downloadgitea-5b2e2d29ca50ba4c11a44d4f1de18ffcf215ba1b.tar.gz
gitea-5b2e2d29ca50ba4c11a44d4f1de18ffcf215ba1b.zip
Upgrade levelqueue to v0.4.0 (#16560)
Fix #16546
-rw-r--r--go.mod2
-rw-r--r--go.sum2
-rw-r--r--vendor/gitea.com/lunny/levelqueue/queue.go5
-rw-r--r--vendor/gitea.com/lunny/levelqueue/set.go2
-rw-r--r--vendor/gitea.com/lunny/levelqueue/uniquequeue.go2
-rw-r--r--vendor/modules.txt2
6 files changed, 13 insertions, 2 deletions
diff --git a/go.mod b/go.mod
index 70e85acecb..8bb369f3b7 100644
--- a/go.mod
+++ b/go.mod
@@ -10,7 +10,7 @@ require (
gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e
gitea.com/go-chi/captcha v0.0.0-20210110083842-e7696c336a1e
gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee
- gitea.com/lunny/levelqueue v0.3.0
+ gitea.com/lunny/levelqueue v0.4.0
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/NYTimes/gziphandler v1.1.1
github.com/ProtonMail/go-crypto v0.0.0-20210705153151-cc34b1f6908b // indirect
diff --git a/go.sum b/go.sum
index d8afa3ec4c..b8815e4136 100644
--- a/go.sum
+++ b/go.sum
@@ -51,6 +51,8 @@ gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee h1:9U6HuKUBt/cGK6T/6
gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee/go.mod h1:Ozg8IchVNb/Udg+ui39iHRYqVHSvf3C99ixdpLR8Vu0=
gitea.com/lunny/levelqueue v0.3.0 h1:MHn1GuSZkxvVEDMyAPqlc7A3cOW+q8RcGhRgH/xtm6I=
gitea.com/lunny/levelqueue v0.3.0/go.mod h1:HBqmLbz56JWpfEGG0prskAV97ATNRoj5LDmPicD22hU=
+gitea.com/lunny/levelqueue v0.4.0 h1:v+bCR1lwLTBpZMshguWNhGIFLkUj+R04pgaU3TcJFS8=
+gitea.com/lunny/levelqueue v0.4.0/go.mod h1:HBqmLbz56JWpfEGG0prskAV97ATNRoj5LDmPicD22hU=
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s=
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU=
github.com/6543/go-version v1.3.1 h1:HvOp+Telns7HWJ2Xo/05YXQSB2bE0WmVgbHqwMPZT4U=
diff --git a/vendor/gitea.com/lunny/levelqueue/queue.go b/vendor/gitea.com/lunny/levelqueue/queue.go
index 0570cc572d..948e019be8 100644
--- a/vendor/gitea.com/lunny/levelqueue/queue.go
+++ b/vendor/gitea.com/lunny/levelqueue/queue.go
@@ -295,6 +295,11 @@ func (queue *Queue) LHandle(h func([]byte) error) error {
// Close closes the queue (and the underlying db is set to closeUnderlyingDB)
func (queue *Queue) Close() error {
+ queue.highLock.Lock()
+ queue.lowLock.Lock()
+ defer queue.highLock.Unlock()
+ defer queue.lowLock.Unlock()
+
if !queue.closeUnderlyingDB {
queue.db = nil
return nil
diff --git a/vendor/gitea.com/lunny/levelqueue/set.go b/vendor/gitea.com/lunny/levelqueue/set.go
index f5995cb8f1..7e0e65c554 100644
--- a/vendor/gitea.com/lunny/levelqueue/set.go
+++ b/vendor/gitea.com/lunny/levelqueue/set.go
@@ -107,6 +107,8 @@ func (set *Set) Remove(value []byte) (bool, error) {
// Close closes the set (and the underlying db if set to closeUnderlyingDB)
func (set *Set) Close() error {
+ set.lock.Lock()
+ defer set.lock.Unlock()
if !set.closeUnderlyingDB {
set.db = nil
return nil
diff --git a/vendor/gitea.com/lunny/levelqueue/uniquequeue.go b/vendor/gitea.com/lunny/levelqueue/uniquequeue.go
index a53abb2c4e..8d66e008de 100644
--- a/vendor/gitea.com/lunny/levelqueue/uniquequeue.go
+++ b/vendor/gitea.com/lunny/levelqueue/uniquequeue.go
@@ -181,6 +181,8 @@ func (queue *UniqueQueue) Len() int64 {
func (queue *UniqueQueue) Close() error {
_ = queue.q.Close()
_ = queue.set.Close()
+ queue.set.lock.Lock()
+ defer queue.set.lock.Unlock()
if !queue.closeUnderlyingDB {
queue.db = nil
return nil
diff --git a/vendor/modules.txt b/vendor/modules.txt
index e3fe6e6b79..32251f41e0 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -25,7 +25,7 @@ gitea.com/go-chi/session/couchbase
gitea.com/go-chi/session/memcache
gitea.com/go-chi/session/mysql
gitea.com/go-chi/session/postgres
-# gitea.com/lunny/levelqueue v0.3.0
+# gitea.com/lunny/levelqueue v0.4.0
## explicit
gitea.com/lunny/levelqueue
# github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c