diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-30 10:16:27 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-30 10:16:27 +0100 |
commit | 9567011bf01f36c7f796ac1e0f1fb12c71635e53 (patch) | |
tree | bec3ed173767cff031ed0a84231d6dd50e792569 /server/initializers/database.ts | |
parent | 757f0da370a992cf07afd20d3829b2748c76cc15 (diff) | |
download | PeerTube-9567011bf01f36c7f796ac1e0f1fb12c71635e53.tar.gz PeerTube-9567011bf01f36c7f796ac1e0f1fb12c71635e53.tar.zst PeerTube-9567011bf01f36c7f796ac1e0f1fb12c71635e53.zip |
Add lazy description on server
Diffstat (limited to 'server/initializers/database.ts')
-rw-r--r-- | server/initializers/database.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/initializers/database.ts b/server/initializers/database.ts index dfad01581..141566c3a 100644 --- a/server/initializers/database.ts +++ b/server/initializers/database.ts | |||
@@ -84,9 +84,14 @@ database.init = async (silent: boolean) => { | |||
84 | const filePaths = await getModelFiles(modelDirectory) | 84 | const filePaths = await getModelFiles(modelDirectory) |
85 | 85 | ||
86 | for (const filePath of filePaths) { | 86 | for (const filePath of filePaths) { |
87 | const model = sequelize.import(filePath) | 87 | try { |
88 | const model = sequelize.import(filePath) | ||
88 | 89 | ||
89 | database[model['name']] = model | 90 | database[model['name']] = model |
91 | } catch (err) { | ||
92 | logger.error('Cannot import database model %s.', filePath, err) | ||
93 | process.exit(0) | ||
94 | } | ||
90 | } | 95 | } |
91 | 96 | ||
92 | for (const modelName of Object.keys(database)) { | 97 | for (const modelName of Object.keys(database)) { |