Spaces:
Paused
Paused
File size: 592 Bytes
bb69f9b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
const { Client, logger } = require('./lib/client')
const { DATABASE, VERSION } = require('./config')
const { stopInstance } = require('./lib/pm2')
const start = async () => {
logger.info(`levanter ${VERSION}`)
try {
await DATABASE.authenticate({ retry: { max: 3 } })
} catch (error) {
const databaseUrl = process.env.DATABASE_URL
logger.error({ msg: 'Unable to connect to the database', error: error.message, databaseUrl })
return stopInstance()
}
try {
const bot = new Client()
await bot.connect()
} catch (error) {
logger.error(error)
}
}
start()
|