Etemplate: Add a timeout to waiting for widgets to load so we can more easily know what happened & track it down.

This commit is contained in:
nathan 2024-09-06 11:04:17 -06:00
parent f4438ac59d
commit df20d58abf

View File

@ -745,7 +745,23 @@ export class etemplate2
// to run. // to run.
setTimeout(() => setTimeout(() =>
{ {
Promise.all(deferred).then(() => Promise.race([Promise.all(deferred),
// If loading takes too long, give some feedback so we can try to track down why
new Promise((resolve) =>
{
setTimeout(() =>
{
if(this.ready)
{
return;
}
egw.debug("error", "Loading timeout");
console.debug("Deferred widget list, look for widgets still pending.", deferred);
resolve()
}, 10000
);
})
]).then(() =>
{ {
console.timeEnd("deferred"); console.timeEnd("deferred");