-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0056fb2
commit 35815bd
Showing
3 changed files
with
10 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ import ( | |
"sync" | ||
"time" | ||
|
||
"github.com/joncrlsn/dque" | ||
"github.com/rs/zerolog/log" | ||
"go.mondoo.com/pdque" | ||
Check failure on line 13 in policy/scan/disk_queue.go GitHub Actions / go-test
Check failure on line 13 in policy/scan/disk_queue.go GitHub Actions / go-test
Check failure on line 13 in policy/scan/disk_queue.go GitHub Actions / go-test
|
||
"google.golang.org/protobuf/proto" | ||
) | ||
|
||
|
@@ -40,7 +40,7 @@ type queuePayload struct { | |
} | ||
|
||
type diskQueueClient struct { | ||
queue *dque.DQue | ||
queue *pdque.Queue | ||
once sync.Once | ||
wg sync.WaitGroup | ||
entries chan Job | ||
|
@@ -68,15 +68,11 @@ func newDqueClient(config diskQueueConfig, handler func(job *Job)) (*diskQueueCl | |
return nil, fmt.Errorf("cannot create queue directory: %s", err) | ||
} | ||
|
||
q.queue, err = dque.NewOrOpen(config.filename, config.dir, config.segmentSize, diskQueueEntryBuilder) | ||
q.queue, err = pdque.NewOrOpen(config.filename, config.dir, config.segmentSize, diskQueueEntryBuilder) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if !config.sync { | ||
_ = q.queue.TurboOn() | ||
} | ||
|
||
q.entries = make(chan Job) | ||
|
||
q.wg.Add(2) | ||
|
@@ -127,7 +123,7 @@ func (c *diskQueueClient) popper() { | |
entry, err := c.queue.DequeueBlock() | ||
if err != nil { | ||
switch err { | ||
case dque.ErrQueueClosed: | ||
case pdque.ErrQueueClosed: | ||
return | ||
default: | ||
log.Error().Err(err).Msg("could not pop job from disk queue") | ||
|