Add support for commands and startups which return promises (#9103)

This commit is contained in:
Arlen Beiler
2025-10-09 16:06:03 +01:00
committed by GitHub
parent 64fce62075
commit 6e493755be
2 changed files with 14 additions and 8 deletions
+6 -4
View File
@@ -2629,11 +2629,13 @@ $tw.boot.executeNextStartupTask = function(callback) {
$tw.boot.log(s.join(" "));
// Execute task
if(!$tw.utils.hop(task,"synchronous") || task.synchronous) {
task.startup();
if(task.name) {
$tw.boot.executedStartupModules[task.name] = true;
const thenable = task.startup();
if(thenable && typeof thenable.then === "function"){
thenable.then(asyncTaskCallback);
return true;
} else {
return asyncTaskCallback();
}
return $tw.boot.executeNextStartupTask(callback);
} else {
task.startup(asyncTaskCallback);
return true;