poad 2.78.1 → 2.78.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/global/start.js +13 -2
- package/package.json +1 -1
package/global/start.js
CHANGED
|
@@ -59,7 +59,16 @@ module.exports = async (args = {}) => {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
// Services optionnels à lancer, puis l'état complet du projet
|
|
62
|
-
|
|
62
|
+
// Engine qui vient d'être lancé : l'état (« structure changed outside the journal »…) n'est lu qu'une fois ses
|
|
63
|
+
// migrations jouées (migrate-upgrade.sh, avant auth et storage) ; sinon une montée était lue à moitié faite
|
|
64
|
+
let engineReady = false;
|
|
65
|
+
const finish = async (justStarted = false) => {
|
|
66
|
+
if (justStarted && !engineReady) {
|
|
67
|
+
const migrations = require('../utils/migrations');
|
|
68
|
+
const waiting = ora('Waiting for the engine').start();
|
|
69
|
+
engineReady = (await migrations.waitForDb(config)) && (await migrations.waitForServices(config));
|
|
70
|
+
waiting.stop();
|
|
71
|
+
}
|
|
63
72
|
const targets = bare ? [] : all ? SERVICES.filter((s) => s.optional && s.configured(config)) : autostartServices(config, root);
|
|
64
73
|
// Groupe « Services » de la console (Mailpit, Keycloak) : ports de cette machine, après leur réattribution
|
|
65
74
|
require('../utils/console-services').write(root);
|
|
@@ -248,6 +257,7 @@ module.exports = async (args = {}) => {
|
|
|
248
257
|
if (migrate || seed || hasReference) {
|
|
249
258
|
const waiting = ora(fresh ? 'Waiting for the new database' : 'Waiting for the database to apply migrations').start();
|
|
250
259
|
const ready = (await migrations.waitForDb(config)) && (await migrations.waitForServices(config));
|
|
260
|
+
engineReady = ready;
|
|
251
261
|
if (!ready) {
|
|
252
262
|
waiting.fail(chalk.redBright('The engine does not answer: migrations and seed not applied (poad migrate, poad db seed later).'));
|
|
253
263
|
process.exitCode = 1;
|
|
@@ -266,8 +276,9 @@ module.exports = async (args = {}) => {
|
|
|
266
276
|
const transforms = require('../utils/transforms');
|
|
267
277
|
if (transforms.hasModels(root) && !process.exitCode) {
|
|
268
278
|
const ready = migrate || seed || hasReference || ((await migrations.waitForDb(config)) && (await migrations.waitForServices(config)));
|
|
279
|
+
engineReady = engineReady || ready;
|
|
269
280
|
if (ready && !(await transforms.build(root, config, { fresh }))) process.exitCode = 1;
|
|
270
281
|
}
|
|
271
282
|
|
|
272
|
-
await finish();
|
|
283
|
+
await finish(true);
|
|
273
284
|
};
|