1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix(migration): Unleash should not start if migration fails.

Closes #320
This commit is contained in:
Ivar Conradi Østhus 2018-05-09 21:20:45 +02:00
parent 089e503a36
commit 4c73d279aa
2 changed files with 10 additions and 4 deletions

View File

@ -2,6 +2,7 @@
## Unreleased
- feat(bind): Added option to bind to specific http address
- fix(migration): Unleash should not start if migration fails.
## 3.0.2
- fix(package): Update unleash-frontend to version 3.0.1

View File

@ -38,12 +38,17 @@ function createApp(options) {
});
}
function start(opts) {
async function start(opts) {
const options = createOptions(opts);
return migrator({ databaseUrl: options.databaseUrl })
.catch(err => logger.error('failed to migrate db', err))
.then(() => createApp(options));
try {
await migrator({ databaseUrl: options.databaseUrl });
} catch (err) {
logger.error('Failed to migrate db', err);
throw err;
}
return createApp(options);
}
module.exports = {