mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 05:01:10 +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() {
|
async initDatabase() {
|
||||||
// Initialize database
|
// Initialize database
|
||||||
this.AppDataSource.initialize()
|
try {
|
||||||
.then(async () => {
|
await this.AppDataSource.initialize()
|
||||||
logger.info('📦 [server]: Data Source is initializing...')
|
logger.info('📦 [server]: Data Source is initializing...')
|
||||||
|
|
||||||
// Run Migrations Scripts
|
// Run Migrations Scripts
|
||||||
@@ -73,10 +73,9 @@ export class App {
|
|||||||
// Initialize telemetry
|
// Initialize telemetry
|
||||||
this.telemetry = new Telemetry()
|
this.telemetry = new Telemetry()
|
||||||
logger.info('📦 [server]: Data Source has been initialized!')
|
logger.info('📦 [server]: Data Source has been initialized!')
|
||||||
})
|
} catch (error) {
|
||||||
.catch((err) => {
|
logger.error('❌ [server]: Error during Data Source initialization:', error)
|
||||||
logger.error('❌ [server]: Error during Data Source initialization:', err)
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async config(socketIO?: Server) {
|
async config(socketIO?: Server) {
|
||||||
|
|||||||
Reference in New Issue
Block a user