Skip to content

Commit

Permalink
pass dequeueLock by reference (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiszaher committed Aug 9, 2021
1 parent eae4d9f commit 34a2c21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/core/db/boltdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (b *BoltDB) Unlock(p models.Project, workspace string) (*models.ProjectLock

// Queue has items, get the next in line
// TODO monikma will this dequeueing info not get to the PR comment?
return b.dequeueNextInLine(dequeuedLock, currQueue, bucket, key, queueBucket)
return b.dequeueNextInLine(&dequeuedLock, currQueue, bucket, key, queueBucket)
})

err = errors.Wrap(err, "DB transaction failed")
Expand All @@ -236,8 +236,8 @@ func (b *BoltDB) Unlock(p models.Project, workspace string) (*models.ProjectLock
return nil, nil, err
}

func (b *BoltDB) dequeueNextInLine(dequeuedLock models.ProjectLock, currQueue []models.ProjectLock, bucket *bolt.Bucket, key string, queueBucket *bolt.Bucket) error {
dequeuedLock = currQueue[0]
func (b *BoltDB) dequeueNextInLine(dequeuedLock *models.ProjectLock, currQueue []models.ProjectLock, bucket *bolt.Bucket, key string, queueBucket *bolt.Bucket) error {
*dequeuedLock = currQueue[0]
newQueue := currQueue[1:]

dequeuedLockSerialized, _ := json.Marshal(dequeuedLock)
Expand Down

0 comments on commit 34a2c21

Please sign in to comment.