add more logs

This commit is contained in:
Hongbo Wu
2024-04-23 15:50:00 +08:00
parent 1b6f4976d3
commit 2f7c18b363
3 changed files with 8 additions and 7 deletions

View File

@ -343,8 +343,14 @@ const main = async () => {
})
})
await worker.close()
console.log('[queue-processor]: Worker closed')
await redisDataSource.shutdown()
console.log('[queue-processor]: Redis connection closed')
await appDataSource.destroy()
console.log('[queue-processor]: DB connection closed')
process.exit(0)
}

View File

@ -178,9 +178,8 @@ const main = async (): Promise<void> => {
await apollo.stop()
console.log('[api]: Express server stopped')
console.log('[posthog]: flushing events')
await analytics.shutdownAsync()
console.log('[posthog]: events flushed')
console.log('[api]: Posthog events flushed')
// Shutdown redis before DB because the quit sequence can
// cause appDataSource to get reloaded in the callback

View File

@ -650,11 +650,7 @@ export const buildQuery = (
queryBuilder.where('library_item.user_id = :userId', { userId })
// add select
selects.forEach((select, index) => {
if (index === 0) {
queryBuilder.select(select.column, select.alias)
}
selects.forEach((select) => {
queryBuilder.addSelect(select.column, select.alias)
})