Skip to content

Commit 7a1fb5f

Browse files
committed
Correctly respect stoptimeouts on unload cases
and remove legacy extra "for sure" force-terminations
1 parent 980f17a commit 7a1fb5f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/adapter/src/lib/adapter/adapter.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,7 +2741,8 @@ export class AdapterClass extends EventEmitter {
27412741

27422742
/**
27432743
* delays the fulfillment of the promise the amount of time.
2744-
* it will not fulfill during and after adapter shutdown
2744+
* It will directly fulfill without any delay during and after adapter shutdown
2745+
* (e.g. in an unload method)
27452746
*
27462747
* @param timeout - timeout in milliseconds
27472748
* @returns promise when timeout is over
@@ -10922,7 +10923,6 @@ export class AdapterClass extends EventEmitter {
1092210923
exitCode: EXIT_CODES.ADAPTER_REQUESTED_TERMINATION,
1092310924
updateAliveState: false,
1092410925
});
10925-
setTimeout(() => this.terminate(EXIT_CODES.ADAPTER_REQUESTED_TERMINATION), 4000);
1092610926
}
1092710927
}
1092810928
}
@@ -11242,7 +11242,6 @@ export class AdapterClass extends EventEmitter {
1124211242
if (id === `system.adapter.${this.namespace}` && obj?.common?.enabled === false) {
1124311243
this._logger.info(`${this.namespaceLog} Adapter is disabled => stop`);
1124411244
this._stop();
11245-
setTimeout(() => this.terminate(EXIT_CODES.NO_ERROR), 4_000);
1124611245
return;
1124711246
}
1124811247

0 commit comments

Comments
 (0)