Skip to content

Commit ed11967

Browse files
authored
don't double-log fetch errors (#1025)
1 parent 1fbb950 commit ed11967

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Don't double log fetch errors. [PR #1025](https://github.com/riverqueue/river/pull/1025).
13+
1014
## [0.24.0] - 2025-08-16
1115

1216
⚠️ Version 0.24.0 has a breaking change in `HookWorkEnd.WorkEnd` in that a new `JobRow` parameter has been added to the function's signature. Any intergration defining a custom `HookWorkEnd` hook should update its implementation so the hook continues to be called correctly.

producer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ func (p *producer) innerFetchLoop(workCtx context.Context, fetchResultCh chan pr
632632
select {
633633
case result := <-fetchResultCh:
634634
if result.err != nil {
635-
p.Logger.ErrorContext(workCtx, p.Name+": Error fetching jobs", slog.String("err", result.err.Error()))
635+
p.Logger.ErrorContext(workCtx, p.Name+": Error fetching jobs", slog.String("err", result.err.Error()), slog.String("queue", p.config.Queue))
636636
} else if len(result.jobs) > 0 {
637637
p.startNewExecutors(workCtx, result.jobs)
638638

@@ -756,7 +756,6 @@ func (p *producer) dispatchWork(workCtx context.Context, count int, fetchResultC
756756
Schema: p.config.Schema,
757757
})
758758
if err != nil {
759-
p.Logger.ErrorContext(ctx, p.Name+": Error fetching jobs", slog.String("err", err.Error()), slog.String("queue", p.config.Queue))
760759
fetchResultCh <- producerFetchResult{err: err}
761760
return
762761
}

0 commit comments

Comments
 (0)