[core] force null timeout and interval
This commit is contained in:
1 parent
80517e416c
commit
e3b8073c82
2 files changed
+3
-1
No files matched your search
@@ -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`);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ export class SinglePeriodicJobRunner {
|
||||
|
||||
stop() {
|
||||
clearInterval(this.interval);
|
||||
this.interval = null;
|
||||
this.logger.info(`Job stopped`);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user