mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 01:01:11 +03:00
fix initDatabase function by proper use of await in try catch (#2360)
* fix initDatabase function by proper use of await in try catch * lint-fix --------- Co-authored-by: Henry Heng <henryheng@flowiseai.com>
This commit is contained in:
@@ -43,8 +43,8 @@ export class App {
|
||||
|
||||
async initDatabase() {
|
||||
// Initialize database
|
||||
this.AppDataSource.initialize()
|
||||
.then(async () => {
|
||||
try {
|
||||
await this.AppDataSource.initialize()
|
||||
logger.info('📦 [server]: Data Source is initializing...')
|
||||
|
||||
// Run Migrations Scripts
|
||||
@@ -73,10 +73,9 @@ export class App {
|
||||
// Initialize telemetry
|
||||
this.telemetry = new Telemetry()
|
||||
logger.info('📦 [server]: Data Source has been initialized!')
|
||||
})
|
||||
.catch((err) => {
|
||||
logger.error('❌ [server]: Error during Data Source initialization:', err)
|
||||
})
|
||||
} catch (error) {
|
||||
logger.error('❌ [server]: Error during Data Source initialization:', error)
|
||||
}
|
||||
}
|
||||
|
||||
async config(socketIO?: Server) {
|
||||
|
||||
Reference in New Issue
Block a user