timgit / pg-boss

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

Include `expireInSeconds` in the `Job` type #489

Closed abdel closed 2 months ago

abdel commented 2 months ago

There is currently a mismatch between the data returned and type of Job for jobs fetched without metadata. The details returned in the job include the expireInSeconds, see a sample below:

[
  {
    id: 'd2c11056-0a3f-42f3-850b-a2b0bc9775e6',
    name: 'myQueue',
    data: { foo: 1, bar: '1' },
    expireInSeconds: '900.000000'
  }
]

This also changes JobWithMetadata to extend the Job to ensure the base type is consistent