Skip to content

Commit

Permalink
mongodb prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Geczy committed Aug 19, 2024
1 parent 2f8b2e0 commit 032336c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/steam/src/MongoDBSingleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ class MongoDBSingleton {
// Connect to MongoDB
const mongoURL = process.env.MONGO_URL
if (!mongoURL) throw new Error('MONGO_URL not set')
const client = await MongoClient.connect(mongoURL)
const client = await MongoClient.connect(mongoURL, {
ssl: process.env.DOTABOD_ENV === 'production',
}) // Disable SSL
this.mongoClient = client // Store the MongoClient object

// Resolve the promise with the client
resolve(client.db())
} catch (error: any) {
console.log({ error })
logger.info('Retrying mongo connection', { currentAttempt })
// If the retry operation has been exhausted, reject the promise with the error
if (operation.retry(error)) {
Expand Down

0 comments on commit 032336c

Please sign in to comment.