Prevent undefined errors

This commit is contained in:
Manav Rathi 2024-04-11 16:27:27 +05:30
parent 320db9f8b7
commit 33c84f7a08
No known key found for this signature in database

View file

@ -50,7 +50,7 @@ export class SimpleJob<R extends JobResult> {
try {
const jobResult = await this.runCallback();
if (jobResult.shouldBackoff) {
if (jobResult && jobResult.shouldBackoff) {
this.intervalSec = Math.min(
this.config.maxItervalSec,
this.intervalSec * this.config.backoffMultiplier,