Skip to content

Commit

Permalink
rf: remove use of util.format
Browse files Browse the repository at this point in the history
  • Loading branch information
JianqinWang committed Mar 8, 2018
1 parent fa19fc8 commit a9a6b24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions lib/storage/metadata/mongoclient/LogConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const stream = require('stream');
const MongoClient = require('mongodb').MongoClient;
const format = require('util').format;
const { Timestamp } = require('bson');

let lastEndID = undefined;
Expand Down Expand Up @@ -109,9 +108,7 @@ class LogConsumer {
const { replicaSetHosts } = mongoConfig;
// 'local' is the database where MongoDB has oplogs.rs capped collection
this.database = 'local';
this.mongoUrl = format(
'mongodb://%s/local',
replicaSetHosts);
this.mongoUrl = `mongodb://${replicaSetHosts}/local`;
this.logger = logger;
}

Expand Down
7 changes: 2 additions & 5 deletions lib/storage/metadata/mongoclient/MongoClientInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
const async = require('async');

const format = require('util').format;
const constants = require('../../../constants');

const errors = require('../../../errors');
Expand Down Expand Up @@ -82,10 +81,8 @@ class MongoClientInterface {
constructor(params) {
const { replicaSetHosts, path, database, logger,
replicationGroupId, replicaSet } = params;
this.mongoUrl = format(
'mongodb://%s/?replicaSet=%s',
replicaSetHosts,
replicaSet);
this.mongoUrl = `mongodb://${replicaSetHosts}/?replicaSet=` +
`${replicaSet}`;
this.logger = logger;
this.client = null;
this.db = null;
Expand Down

0 comments on commit a9a6b24

Please sign in to comment.