jhunters / bigqueue

Golang implements for BigQueue
Apache License 2.0
56 stars 24 forks source link

can not open queue because of permission denied #23

Open bilxio opened 2 years ago

bilxio commented 2 years ago

Hi there,

Recently, I wrote a simple prototype which required a dick-based queue.

After I copied the snippet, and then bad luck, I got an error like:

➜  logpipe (main) ✗ go run main.go
panic: mkdir data/testqueue/index: permission denied

goroutine 1 [running]:
go.example.com/logpipe/app.New()
        /Users/admin/logpipe/app/logpipe.go:48 +0x145
main.main()
        /Users/admin/logpipe/main.go:22 +0x9e
exit status 2

the code snippet like:

var queue = new(bigqueue.FileQueue)

err := queue.Open("data", "testqueue", nil)

if err != nil {
  panic(err)
}
defer queue.Close()

go.mod

require (
    github.com/jhunters/bigqueue v1.2.2
)

finanlly, check the data dir out,

➜  logpipe (main) ✗ ll data 
total 0
d---------  2 admin  staff    64B Jul  1 15:39 testqueue
drwxr-x---  3 admin  staff    96B Jul  1 15:31 wal
➜  logpipe (main) ✗ ll data/testqueue 
total 0
ls: data/testqueue: Permission denied

Thanks.

bilxio commented 2 years ago

By the way, there is a pull #21 which covered this issue already.