Add to throw error when server not ready after db synced

This commit is contained in:
Wu Cheng-Han 2016-11-07 21:31:11 +08:00
parent b5920fbbd1
commit b9c4af8a65
1 changed files with 2 additions and 0 deletions

2
app.js
View File

@ -487,6 +487,8 @@ models.sequelize.sync().then(function () {
if (err) throw new Error(err);
if (!notes || notes.length <= 0) return startListen();
});
} else {
throw new Error('server still not ready after db synced');
}
});