[core] force null timeout and interval

This commit is contained in:
devlikepro committed 2024-09-09 14:23:07 +07:00
1 parent 80517e416c
commit e3b8073c82
2 files changed
+3 -1

No files matched your search

+2 -1
View File
@@ -30,10 +30,10 @@ export class SingleDelayedJobRunner {
}
this.timeout = setTimeout(() => {
this.timeout = null;
this.logger.debug(`Running job...`);
fn().finally(() => {
this.logger.debug(`Job finished`);
this.timeout = null;
});
}, this.timeoutMs);
this.logger.info(`Job scheduled with timeout ${this.timeoutMs} ms`);
@@ -42,6 +42,7 @@ export class SingleDelayedJobRunner {
cancel() {
clearTimeout(this.timeout);
this.timeout = null;
this.logger.info(`Job cancelled`);
}
+1
View File
@@ -51,6 +51,7 @@ export class SinglePeriodicJobRunner {
stop() {
clearInterval(this.interval);
this.interval = null;
this.logger.info(`Job stopped`);
}