From 09fdbc5d6e00fd071d4cb1bfdf5167c33f7935d1 Mon Sep 17 00:00:00 2001 From: Silverkron Date: Tue, 12 Mar 2019 10:24:25 +0100 Subject: [PATCH 1/2] fix generation with a lot of models --- bin/lb-ng.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/lb-ng.js b/bin/lb-ng.js index d51ccfe..7d85a93 100755 --- a/bin/lb-ng.js +++ b/bin/lb-ng.js @@ -40,7 +40,9 @@ assertLoopBackVersion(); if (app.booting) { app.on('booted', runGenerator); } else { - runGenerator(); + setTimeout(function () { + runGenerator(); + }, 1000); } function runGenerator() { From 9f66eb6a0e644d647889aee09a7ee8385d0c8bf9 Mon Sep 17 00:00:00 2001 From: Silverkron Date: Tue, 12 Mar 2019 14:44:30 +0100 Subject: [PATCH 2/2] fix: replaced hard-coded timeout with booting status check --- bin/lb-ng.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/lb-ng.js b/bin/lb-ng.js index 7d85a93..0d6acc3 100755 --- a/bin/lb-ng.js +++ b/bin/lb-ng.js @@ -37,12 +37,10 @@ g.error('Loading {{LoopBack}} app %j', appFile); var app = require(appFile); assertLoopBackVersion(); -if (app.booting) { +if (app.booting !== false) { app.on('booted', runGenerator); } else { - setTimeout(function () { - runGenerator(); - }, 1000); + runGenerator(); } function runGenerator() {