Merge "In gr-endpoint-decorator, only log timeout in case of timeout"

This commit is contained in:
Viktar Donich
2017-12-09 06:04:29 +00:00
committed by Gerrit Code Review

View File

@@ -76,15 +76,18 @@
paramEl => plugin.attributeHelper(paramEl).get('value')
.then(value => el[paramEl.getAttribute('name')] = value)
);
let timeoutId;
const timeout = new Promise(
resolve => setTimeout(() => {
resolve => timeoutId = setTimeout(() => {
console.warn(
'Timeout waiting for endpoint properties initialization.' +
'Timeout waiting for endpoint properties initialization: ' +
`plugin ${plugin.getPluginName()}, endpoint ${this.name}`);
resolve();
}, INIT_PROPERTIES_TIMEOUT_MS));
return Promise.race([timeout, Promise.all(expectProperties)])
.then(() => el);
.then(() => {
clearTimeout(timeoutId);
return el;
});
},
_appendChild(el) {