thank your very much for developing this valuable project.
Unfortunately, I just spent a few hours trying to figure out why the onComplete feature (documented here) didn't work. Turns out, one has to enable it when instantiating pg-boss.
Example:
import PgBoss from "pg-boss";
const pgBoss = new PgBoss({
// option must be enabled for pgBoss.onComplete to work
onComplete: true,
});
// now I can use it like so
pgBoss.onComplete("*", (job) => { ... })
Hi there,
thank your very much for developing this valuable project.
Unfortunately, I just spent a few hours trying to figure out why the
onComplete
feature (documented here) didn't work. Turns out, one has to enable it when instantiatingpg-boss
.Example:
However, this requirement is neither documented in the 'instantiate pg-boss with options' section nor the 'onComplete method' section.
Note: I just noticed there's a small documentation about it in the section about the
send
method.I wish it would be obvious that one has to enable this option globally to make use of this feature :).