Update main.js

This commit is contained in:
钟进 2018-09-25 11:33:04 +08:00
parent 9305b4aad3
commit 690fc3afa3

23
main.js
View File

@ -297,5 +297,28 @@ function main() {
});
// try to load certificates
if (adapter.config.secure) {
// Load certificates
// Load certificates
adapter.getCertificates(function (err, certificates, leConfig) {
adapter.config.certificates = certificates;
adapter.config.leConfig = leConfig;
initWebServer(adapter.config);
});
} else {
initWebServer(adapter.config);
}
// Convert port to number
adapter.config.interval = parseInt(adapter.config.interval, 10);
// If interval and URl are set => poll it every X milliseconds
if (adapter.config.interval && adapter.config.pollURL) {
// initial poll
pollData();
// poll every x milliseconds
timer = setInterval(pollData, adapter.config.interval);
}
}