acaloiaro / neoq

Queue-agnostic background job library for Go, with a pleasant API and powerful features.
MIT License
270 stars 4 forks source link

fix(pg): Fixed error logs for multi node cron jobs. #94

Closed elliotcourant closed 1 year ago

elliotcourant commented 1 year ago

When multiple nodes were participating as workers and a cron job was to be enqueued, all nodes would attempt to enqueue it at the same time. As a result all but one node would successfully enqueue the job and the other nodes would log a message about a duplicate job. In any other scenario this would be a log that would be good to surface, but it is not a significant error message here as the job was still enqueued properly.

Resolves #76


@acaloiaro Thoughts on testing this? I could add a test for just a multi node cron job in general and assert that it is only performed once with multiple workers. But actually asserting that the log is not shown anymore doesn't seem like a useful test? Let me know what your thoughts are.