summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
authorDavid Mehren2021-03-04 20:33:30 +0100
committerGitHub2021-03-04 20:33:30 +0100
commit64a2fb8be71792e15b76fceeb948ddfc3c9de704 (patch)
tree4bf5d1771c172d052246530f76316b5b997dd9c0 /app.js
parent6186e0f48f3414e9de4ab5f864c2d153aa995c51 (diff)
parentb47f1e80b43839de20591544dacd016822bacb63 (diff)
Merge pull request #969 from hedgedoc/feature/port_automated_migrations
Diffstat (limited to 'app.js')
-rw-r--r--app.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/app.js b/app.js
index ae332d98..ce37032b 100644
--- a/app.js
+++ b/app.js
@@ -264,16 +264,19 @@ function startListen () {
}
// sync db then start listen
-models.sequelize.sync().then(function () {
- // check if realtime is ready
- if (realtime.isReady()) {
- models.Revision.checkAllNotesRevision(function (err, notes) {
- if (err) throw new Error(err)
- if (!notes || notes.length <= 0) return startListen()
- })
- } else {
- throw new Error('server still not ready after db synced')
- }
+models.sequelize.authenticate().then(function () {
+ models.runMigrations().then(() => {
+ sessionStore.sync()
+ // check if realtime is ready
+ if (realtime.isReady()) {
+ models.Revision.checkAllNotesRevision(function (err, notes) {
+ if (err) throw new Error(err)
+ if (!notes || notes.length <= 0) return startListen()
+ })
+ } else {
+ throw new Error('server still not ready after db synced')
+ }
+ })
})
// log uncaught exception