Do not compare error's string output

This commit is contained in:
Juan C. Müller 2023-02-19 10:32:09 -05:00
parent da96409f30
commit e3fa7d96f8
No known key found for this signature in database
GPG key ID: A76E55A7FBA1E283

View file

@ -538,7 +538,7 @@ func (w PgBackend) start(ctx context.Context, queue string) (err error) {
}
if err != nil {
if err.Error() == "no rows in result set" {
if errors.Is(err, pgx.ErrNoRows) {
err = nil
} else {
w.logger.Error("error handling job", err, "job_id", jobID)
@ -660,7 +660,7 @@ func (w PgBackend) pendingJobs(ctx context.Context, queue string) (jobsCh chan i
for {
jobID, err := w.getPendingJobID(ctx, conn, queue)
if err != nil {
if err.Error() != "no rows in result set" {
if !errors.Is(err, pgx.ErrNoRows) {
w.logger.Error("failed to fetch pending job", err, "job_id", jobID)
} else {
// done fetching pending jobs