timgit / pg-boss

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

Ability to override query in Boss.countStatesCommand #356

Closed craigdub closed 1 year ago

craigdub commented 1 year ago

Would like the ability to override the query for Boss.countStatesCommand. The reason being is people may want to ignore testing/legacy jobs to be counted in these metrics by filtering within the query itself. Let me now what you think. Can help out with implementation here if you agree.

timgit commented 1 year ago

You can run the same query that pg-boss uses internally against the job table if you would like. If you would like to continue using the event, perhaps you could use a naming convention to filter them out from the results.