Open klein0r opened 2 years ago
The stop link is "wrong" because this is the full internalmethod. exposed are:
In fact terminate bypasses the unload handling completely, so it needs to be used carefully and should not be used if the adapter support compact mode. So terminate is mostly used in schedule adapters (that are FOR NOW never run in compact mode) ... or adapter needs to make sure that all resources are free'd.
So what's best practice now for scheduled adapters? I've had the issue, that the integration tests failed when the adapters quits "too early" (because .alive is false) -> https://github.com/ioBroker/testing/issues/474
Has
setTimeout(async () => adapter.stop(), 6000);
the same effect as setting common.stopTimeout: 6000
in io-package?
Answer this this are:
Explain
.alive
Object/Statethis.stop()
vsthis.terminate()
(stop calls terminate)common.stopTimeout
in io-packagehttps://github.com/ioBroker/ioBroker.js-controller/blob/9ce695a3355a5f2e59532c070a55fdb76e0185b3/packages/adapter/src/lib/adapter/adapter.js#L245
https://github.com/ioBroker/ioBroker.js-controller/blob/9ce695a3355a5f2e59532c070a55fdb76e0185b3/packages/adapter/src/lib/adapter/adapter.js#L9223