1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Upgrade levelqueue 0.4.1 (#16696) (#16700)

This commit is contained in:
Lunny Xiao
2021-08-16 15:37:27 +08:00
committed by GitHub
parent d89029ebac
commit b6508b872b
4 changed files with 8 additions and 8 deletions

View File

@@ -21,8 +21,8 @@ const (
// Queue defines a queue struct
type Queue struct {
db *leveldb.DB
highLock sync.Mutex
lowLock sync.Mutex
lowLock sync.Mutex // If you are locking both high and low locks, lock the low lock before the high lock
highLock sync.Mutex // If you are locking both high and low locks, lock the low lock before the high lock
low int64
high int64
lowKey []byte
@@ -295,10 +295,10 @@ 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()
queue.highLock.Lock()
defer queue.lowLock.Unlock()
defer queue.highLock.Unlock()
if !queue.closeUnderlyingDB {
queue.db = nil

2
vendor/modules.txt vendored
View File

@@ -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.4.0
# gitea.com/lunny/levelqueue v0.4.1
## explicit
gitea.com/lunny/levelqueue
# github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c