github riverqueue/river v0.17.0

latest releases: v0.18.0, rivertype/v0.18.0, rivershared/v0.18.0...
7 days ago

Added

  • Exposed TestConfig struct on Config under the Test field for configuration that is specific to test environments. For now, the only field on this type is Time, which can be used to set a synthetic TimeGenerator for tests. A stubbable time generator was added as rivertest.TimeStub to allow time to be easily stubbed in tests. PR #754.
  • New rivertest.Worker type to make it significantly easier to test River workers. Either real or synthetic jobs can be worked using this interface, generally without requiring any database interactions. The Worker type provides a realistic execution environment with access to the full range of River features, including river.ClientFromContext, middleware (both global and per-worker), and timeouts. PR #753.

Changed

  • Errors returned from retryable jobs are now logged with warning logs instead of error logs. Error logs are still used for jobs that error after reaching max_attempts. PR #743.
  • Remove range variable capture in for loops and use simplified range syntax. Each of these requires Go 1.22 or later, which was already our minimum required version since Go 1.23 was released. PR #755.

Fixed

  • riverdatabasesql driver: properly handle nil values in bytea[] inputs. This fixes the driver's handling of empty unique keys on insert for non-unique jobs with the newer unique jobs implementation. PR #739.
  • JobCompleteTx now returns rivertype.ErrNotFound if the job doesn't exist instead of panicking. PR #753.
    • NeverSchedule.Next now returns the correct maximum time value, ensuring that the periodic job truly never runs. This fixes an issue where an incorrect maximum timestamp was previously used. Thanks Hubert Krauze (@krhubert)! PR #760

Don't miss a new river release

NewReleases is sending notifications on new releases.