Wait index creaction

This commit is contained in:
Chocobozzz 2023-11-13 11:06:50 +01:00
parent 6d96cfab43
commit 71e310f639
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 3 deletions

View File

@ -149,15 +149,15 @@ app.use(function (err, req, res, next) {
app.listen(CONFIG.LISTEN.PORT, async () => {
logger.info('Server listening on port %d', CONFIG.LISTEN.PORT)
IndexationScheduler.Instance.enable()
try {
await IndexationScheduler.Instance.initIndexes()
} catch (err) {
logger.error(err, 'Cannot init videos index.')
logger.error(err, 'Cannot init indexes.')
process.exit(-1)
}
IndexationScheduler.Instance.enable()
IndexationScheduler.Instance.execute()
.catch(err => logger.error(err, 'Cannot run video indexer'))
})