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:
parent
089e503a36
commit
4c73d279aa
@ -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
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user