Skip to content

Commit

Permalink
Merge pull request #1718 from dgomezc/1717-FailedMongoDBService
Browse files Browse the repository at this point in the history
Fix Cosmos MongoDB services in all backend framework
  • Loading branch information
sibille committed Feb 17, 2021
2 parents 0ed54e2 + 656bec8 commit 884abda
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ private IMongoClient InitializeCosmosClientInstance()

settings.UseTls = true;
settings.SslSettings = new SslSettings() { EnabledSslProtocols = SslProtocols.Tls12 };
settings.RetryWrites = false;

return new MongoClient(settings);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@



client = MongoClient(connection_str + '?ssl=true&replicaSet=globaldb')
client = MongoClient(connection_str + '?ssl=true&replicaSet=globaldb&retryWrites=false')

db = client[CONSTANTS['COSMOS']['COLLECTION']]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module.exports = opt => {
password: process.env.COSMOSDB_PASSWORD
},
useNewUrlParser: true,
useUnifiedTopology: true
useUnifiedTopology: true,
retryWrites: false
}
),
// Set DB collection name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ function connect() {
user: process.env.COSMOSDB_USER,
password: process.env.COSMOSDB_PASSWORD
},
useNewUrlParser: true
useNewUrlParser: true,
useUnifiedTopology: true,
retryWrites: false
})
.then(() => console.log("Connection to CosmosDB successful"))
.catch(err => console.error(err));
Expand Down

0 comments on commit 884abda

Please sign in to comment.