Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ jobs:
name: lint
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_VERSION: v2.2.1
GOLANGCI_LINT_VERSION: v2.3.0
permissions:
contents: read
# allow read access to pull request. Use with `only-new-issues` option.
Expand Down
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,16 +559,16 @@ type QueueConfig struct {

func (c QueueConfig) validate(queueName string, clientFetchCooldown time.Duration, clientFetchPollInterval time.Duration) error {
if c.FetchCooldown < 0 {
return fmt.Errorf("FetchCooldown cannot be less than zero")
return errors.New("FetchCooldown cannot be less than zero")
}
if c.FetchPollInterval < 0 {
return fmt.Errorf("FetchPollInterval cannot be less than zero")
return errors.New("FetchPollInterval cannot be less than zero")
}

resolvedFetchCooldown := cmp.Or(c.FetchCooldown, clientFetchCooldown)
resolvedFetchPollInterval := cmp.Or(c.FetchPollInterval, clientFetchPollInterval)
if resolvedFetchPollInterval < resolvedFetchCooldown {
return fmt.Errorf("FetchPollInterval cannot be less than FetchCooldown")
return errors.New("FetchPollInterval cannot be less than FetchCooldown")
}

if c.MaxWorkers < 1 || c.MaxWorkers > QueueNumWorkersMax {
Expand Down
4 changes: 2 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ func Test_Client_Common(t *testing.T) {
require.True(t, hookInsertBeginCalled.Load())
})

t.Run("WithWorkBeginHookOnJobArgs", func(t *testing.T) { //nolint:dupl
t.Run("WithWorkBeginHookOnJobArgs", func(t *testing.T) {
t.Parallel()

_, bundle := setup(t)
Expand Down Expand Up @@ -899,7 +899,7 @@ func Test_Client_Common(t *testing.T) {
require.True(t, hookWorkBeginCalled.Load())
})

t.Run("WithWorkEndHookOnJobArgs", func(t *testing.T) { //nolint:dupl
t.Run("WithWorkEndHookOnJobArgs", func(t *testing.T) {
t.Parallel()

_, bundle := setup(t)
Expand Down
2 changes: 1 addition & 1 deletion rivertype/river_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func UniqueOptsByStateDefault() []JobState {
}
}

// WorkerMetadata is metadata about workers registerd with a client.
// WorkerMetadata is metadata about workers registered with a client.
type WorkerMetadata struct {
// JobArgHooks are job args specific hooks returned from a JobArgsWithHooks
// implementation.
Expand Down
2 changes: 1 addition & 1 deletion worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func AddWorker[T JobArgs](workers *Workers, worker Worker[T]) {
// AddWorkerArgs is the same as AddWorker except that it lets args be passed
// explicitly rather than being instantiated implicitly. We don't know of any
// use for this function beyond exercising some args-related edge cases in tests
// are are difficult/impossible to exercise otherwise, and its use should be
// are difficult/impossible to exercise otherwise, and its use should be
// considered internal only.
func AddWorkerArgs[T JobArgs](workers *Workers, jobArgs T, worker Worker[T]) {
if err := workers.add(jobArgs, &workUnitFactoryWrapper[T]{worker: worker}); err != nil {
Expand Down
Loading