timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.05k stars 157 forks source link

ENONET: no such file or directory, open .yarnclean #41

Closed roytz closed 6 years ago

roytz commented 6 years ago

Hi, I'm using node js v9.1.0 and I'm trying to add pg-boss to my project. After executing the yarn add pg-boss command, I get this error - image

Any ideas?

timgit commented 6 years ago

🤔 I don't run node 9 yet as my primary, but I did install it just now, did a global install of yarn, then ran npm init and chased that with a yarn add pg-boss. I didn't receive any errors:

$ yarn add pg-boss
yarn add v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 19 new dependencies.
├─ bluebird@3.5.1
├─ buffer-writer@1.0.1
├─ js-string-escape@1.0.1
├─ packet-reader@0.3.1
├─ pg-boss@2.3.4
├─ pg-connection-string@0.1.3
├─ pg-pool@2.0.3
├─ pg-types@1.12.1
├─ pg@7.4.0
├─ pgpass@1.0.2
├─ postgres-array@1.0.2
├─ postgres-bytea@1.0.0
├─ postgres-date@1.0.3
├─ postgres-interval@1.1.1
├─ semver@4.3.2
├─ split@1.0.1
├─ through@2.3.8
├─ uuid@3.1.0
└─ xtend@4.0.1
Done in 2.66s.

Administrator@TIM02 C:\Users\Administrator\test1
$ node --version
v9.3.0

Administrator@TIM02 C:\Users\Administrator\test1
$ npm --version
5.5.1

Administrator@TIM02 C:\Users\Administrator\test1
$ yarn --version
1.3.2
roytz commented 6 years ago

Thanks @timgit You're right, it works (I had a local problem). I know it's not related to this issue but I was wondering if pg-boss is multi-thread safe? I mean if there are multiple instances of a server that connects to the same queue, will it cause a problem of processing the same job multiple times?

timgit commented 6 years ago

You're describing exactly how it's designed. PostgreSQL does all the hard work here to make sure the same job is not returned more than once.