Skip to content

Commit 8d6641a

Browse files
committed
refactor: update option name
1 parent 8f89bb8 commit 8d6641a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/cmap/connection_pool.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export interface ConnectionPoolOptions extends Omit<ConnectionOptions, 'id' | 'g
9191
/** If we are in load balancer mode. */
9292
loadBalanced: boolean;
9393
/** @internal */
94-
minPoolSizeCheckIntervalMS?: number;
94+
minPoolSizeCheckFrequencyMS?: number;
9595
}
9696

9797
/** @internal */
@@ -236,7 +236,7 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
236236
maxConnecting: options.maxConnecting ?? 2,
237237
maxIdleTimeMS: options.maxIdleTimeMS ?? 0,
238238
waitQueueTimeoutMS: options.waitQueueTimeoutMS ?? 0,
239-
minPoolSizeCheckIntervalMS: options.minPoolSizeCheckIntervalMS ?? 100,
239+
minPoolSizeCheckFrequencyMS: options.minPoolSizeCheckFrequencyMS ?? 100,
240240
autoEncrypter: options.autoEncrypter,
241241
metadata: options.metadata
242242
});
@@ -688,15 +688,15 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
688688
clearTimeout(this[kMinPoolSizeTimer]);
689689
this[kMinPoolSizeTimer] = setTimeout(
690690
() => this.ensureMinPoolSize(),
691-
this.options.minPoolSizeCheckIntervalMS
691+
this.options.minPoolSizeCheckFrequencyMS
692692
);
693693
}
694694
});
695695
} else {
696696
clearTimeout(this[kMinPoolSizeTimer]);
697697
this[kMinPoolSizeTimer] = setTimeout(
698698
() => this.ensureMinPoolSize(),
699-
this.options.minPoolSizeCheckIntervalMS
699+
this.options.minPoolSizeCheckFrequencyMS
700700
);
701701
}
702702
}

test/tools/cmap_spec_runner.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,10 @@ async function runCmapTest(test: CmapTest, threadContext: ThreadContext) {
351351
const poolOptions = test.poolOptions || {};
352352
expect(CMAP_POOL_OPTION_NAMES).to.include.members(Object.keys(poolOptions));
353353

354-
let minPoolSizeCheckIntervalMS;
354+
let minPoolSizeCheckFrequencyMS;
355355
if (poolOptions.backgroundThreadIntervalMS) {
356356
if (poolOptions.backgroundThreadIntervalMS !== -1) {
357-
minPoolSizeCheckIntervalMS = poolOptions.backgroundThreadIntervalMS;
357+
minPoolSizeCheckFrequencyMS = poolOptions.backgroundThreadIntervalMS;
358358
}
359359
delete poolOptions.backgroundThreadIntervalMS;
360360
}
@@ -376,7 +376,7 @@ async function runCmapTest(test: CmapTest, threadContext: ThreadContext) {
376376
const mainThread = threadContext.getThread(MAIN_THREAD_KEY);
377377
mainThread.start();
378378

379-
threadContext.createPool({ ...poolOptions, metadata, minPoolSizeCheckIntervalMS });
379+
threadContext.createPool({ ...poolOptions, metadata, minPoolSizeCheckFrequencyMS });
380380
// yield control back to the event loop so that the ConnectionPoolCreatedEvent
381381
// has a chance to be fired before any synchronously-emitted events from
382382
// the queued operations

test/unit/cmap/connection_pool.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ describe('Connection Pool', function () {
144144
}
145145
});
146146

147-
it('should respect the minPoolSizeCheckIntervalMS option', function () {
147+
it('should respect the minPoolSizeCheckFrequencyMS option', function () {
148148
const pool = new ConnectionPool(server, {
149149
minPoolSize: 2,
150-
minPoolSizeCheckIntervalMS: 42,
150+
minPoolSizeCheckFrequencyMS: 42,
151151
hostAddress: server.hostAddress()
152152
});
153153
const ensureSpy = sinon.spy(pool, 'ensureMinPoolSize');
@@ -180,7 +180,7 @@ describe('Connection Pool', function () {
180180
expect(createConnStub).to.have.been.calledTwice;
181181
});
182182

183-
it('should default minPoolSizeCheckIntervalMS to 100ms', function () {
183+
it('should default minPoolSizeCheckFrequencyMS to 100ms', function () {
184184
const pool = new ConnectionPool(server, {
185185
minPoolSize: 2,
186186
hostAddress: server.hostAddress()

0 commit comments

Comments
 (0)