Skip to content

Commit

Permalink
fix: update error log to check debug flag
Browse files Browse the repository at this point in the history
  • Loading branch information
davidglivar committed May 4, 2024
1 parent 9392163 commit 73eb187
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class Supaworker<Payload> {
await this.work(job);
await this.log('success', job);
} catch (workError) {
console.error('Error working on job:', workError);
if (this.options.debug) console.error('Error working on job:', workError);
const allowedAttempts = job.options?.max_attempts ?? this.options.max_attempts ?? 1;
if (job.attempts < allowedAttempts) {
await this.enqueue([job]);
Expand Down

0 comments on commit 73eb187

Please sign in to comment.