Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoragrega committed Jan 27, 2021
1 parent fb3af97 commit 4f764bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ a certain amount of times.
As an exercise let's log the job result with our favourite logging library using the
["WithError" wrapper](wrapper/with_error.go);
```go
// jobLogger is a reusable logger wrapper for jobs.
jobLogger := func(jobName string) func(error) {
// resultLogger is a reusable logger wrapper for jobs.
resultLogger := func(jobName string) func(error) {
return func(err error) {
if err != nil {
logger.Error("job failed", "job", jobName, "error", err)
Expand All @@ -224,7 +224,7 @@ job := func(ctx context.Context) error {
}

pool := workers.Must(workers.New(
wrapper.WithError(job, jobLogger("foo"),
wrapper.WithError(job, resultLogger("foo"),
)))
```

Expand Down

0 comments on commit 4f764bd

Please sign in to comment.