Skip to content

Commit 66ebf61

Browse files
committed
Remove WorkerDefaults.Hooks
Remove `WorkerDefaults.Hooks`. I believe this was a vestige left in after a number of refactoring passes as it's not used anywhere (if I recall correctly, workers may have started with hooks, but they were moved to `JobArgs` because hooks the job args part of an args/worker combination are more available in more places). This is technically a breaking change, but this was never used at any point and it shouldn't realistically break anyone.
1 parent 19ce499 commit 66ebf61

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- A logger passed in via `river.Config` now overrides the default test-based logger when using `rivertest.NewWorker`. [PR #980](https://github.com/riverqueue/river/pull/980).
3030
- Cleaner retention periods (`CancelledJobRetentionPeriod`, `CompletedJobRetentionPeriod`, `DiscardedJobRetentionPeriod`) can be configured to -1 to disable them so that the corresponding type of job is retained indefinitely. [PR #990](https://github.com/riverqueue/river/pull/990).
3131
- Jobs inserted from periodic jobs with IDs now have metadata `river:periodic_job_id` set so they can be traced back to the periodic job that inserted them. [PR #992](https://github.com/riverqueue/river/pull/992).
32+
- The unused function `WorkerDefaults.Hooks` has been removed. This is technically a breaking change, but this function was a vestigal refactoring artifact that was never used by anything, so in practice it shouldn't be breaking. [PR #997](https://github.com/riverqueue/river/pull/997).
3233

3334
### Fixed
3435

worker.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ type Worker[T JobArgs] interface {
7474
// struct to make it fulfill the Worker interface with default values.
7575
type WorkerDefaults[T JobArgs] struct{}
7676

77-
func (w WorkerDefaults[T]) Hooks(*rivertype.JobRow) []rivertype.Hook { return nil }
78-
7977
func (w WorkerDefaults[T]) Middleware(*rivertype.JobRow) []rivertype.WorkerMiddleware { return nil }
8078

8179
// NextRetry returns an empty time.Time{} to avoid setting any job or

0 commit comments

Comments
 (0)