Skip to content

v4.0.0

Compare
Choose a tag to compare
@samaratungajs samaratungajs released this 25 Nov 10:37
· 5 commits to main since this release

Release Notes - v4.0.0 πŸš€

Breaking Changes ⚠️

  • Job Arrays in Handlers:

    • @Job and @CronJob handlers now always receive a job array, consistent with PgBoss v10.
  • Support for WorkOptions:

    • The @Job decorator now accepts WorkOptions as its options parameter.
    • This allows configuration, such as specifying batchSize.

Migration Notes πŸ› οΈ

  • Update Handlers:

    // Old
    @Job('MY_JOB')
    async handleJob(job: any) {
      console.log(job.data.id);
    }
    
    // New
    @Job('MY_JOB', { batchSize: 5 }) // Batch size optional; defaults to 1
    async handleJob(jobs: any[]) {
      for (const job of jobs) {
        console.log(job.data.id);
      }
    }

What's Changed

Full Changelog: v3.0.1...v4.0.0