gocraft / work

Process background jobs in Go
MIT License
2.42k stars 342 forks source link

Lack of clarity around MaxConcurrency in README #212

Open dan-pulley opened 2 years ago

dan-pulley commented 2 years ago

The readme specifies "a new job will not be scheduled if we are at or over a job's MaxConcurrency limit."

https://github.com/gocraft/work#job-concurrency

However the code implies the job will still be inserted, it just won't be selected or run.

https://github.com/gocraft/work/blob/5959e69ad211c5ca37ffdf3ede02e35a5ae41d98/redis.go#L107

It appears that this is just an easily misread bit of text - I was concerned from the readme that the job would just fail to be created, but the code strongly seems to indicate that the job simply won't get worked on if we are over the concurrency limit.