Skip to content

Commit

Permalink
let New create the directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuskimmina committed Nov 21, 2023
1 parent fea7db7 commit 9350bd3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions policy/scan/pdque/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ type Queue struct {
}

func New(name string, path string, maxSize int, builder func() interface{}) (*Queue, error) {
err := os.MkdirAll(path, 0o755)
if err != nil {
return nil, err
}
overlyPermissive, err := isOverlyPermissive(path)
if err != nil {
return nil, err
Expand All @@ -73,10 +77,6 @@ func NewOrOpen(name string, path string, maxSize int, builder func() interface{}
var que *Queue
_, err := os.Stat(path)
if os.IsNotExist(err) {
err = os.MkdirAll(path, 0o755)
if err != nil {
return nil, err
}
que, err = New(name, path, maxSize, builder)
if err != nil {
return nil, err
Expand Down

0 comments on commit 9350bd3

Please sign in to comment.