resumeTasks only when configured and platform ready

This commit is contained in:
Girish Ramakrishnan
2016-06-20 14:46:52 -05:00
parent cabed28f1e
commit 6bc14ea7e4

View File

@@ -35,15 +35,14 @@ function initialize(callback) {
locker.on('unlocked', startNextTask);
if (cloudron.isConfiguredSync()) {
resumeTasks();
} else {
cloudron.events.on(cloudron.EVENT_CONFIGURED, resumeTasks);
}
setTimeout(function () {
gPlatformReady = true;
resumeTasks();
if (cloudron.isConfiguredSync()) {
resumeTasks();
} else {
cloudron.events.on(cloudron.EVENT_CONFIGURED, resumeTasks);
}
}, 30000); // wait 30 seconds to signal platform ready
callback();