Skip to content

Commit

Permalink
[init-delay-postgres] fix append result
Browse files Browse the repository at this point in the history
'
  • Loading branch information
truongnguyen101195 committed Apr 19, 2021
1 parent 14047da commit 5f0c6ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions job/storage/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ func (d DB) GetAll() ([]*job.Job, error) {
return nil, err
}
err = nil
jobs := []*job.Job{}
result := make([]*job.Job, 0, len(jobs))
var jobs []*job.Job
if r.Valid {
err = json.Unmarshal([]byte(r.String), &jobs)
}
result := make([]*job.Job, 0, len(jobs))
for _, j := range jobs {
if err = j.InitDelayDuration(false); err != nil {
break
}
result = append(result, j)
}
return jobs, err
return result, err
}

// Get returns a persisted Job.
Expand Down

0 comments on commit 5f0c6ca

Please sign in to comment.