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

2
app.js
View file

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