Skip to content

Commit 8373ccc

Browse files
remove dead code
1 parent 2f3fb46 commit 8373ccc

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ export type {
553553
ReadPreferenceOptions
554554
} from './read_preference';
555555
export type { AsyncDisposable } from './resource_management';
556-
export type { ClusterTime, TimerQueue } from './sdam/common';
556+
export type { ClusterTime } from './sdam/common';
557557
export type {
558558
Monitor,
559559
MonitorEvents,

src/sdam/common.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { clearTimeout } from 'timers';
2-
31
import type { Binary, Long, Timestamp } from '../bson';
42
import type { ClientSession } from '../sessions';
53
import type { Topology } from './topology';
@@ -46,15 +44,6 @@ export const ServerType = Object.freeze({
4644
/** @public */
4745
export type ServerType = (typeof ServerType)[keyof typeof ServerType];
4846

49-
/** @internal */
50-
export type TimerQueue = Set<NodeJS.Timeout>;
51-
52-
/** @internal */
53-
export function drainTimerQueue(queue: TimerQueue): void {
54-
queue.forEach(clearTimeout);
55-
queue.clear();
56-
}
57-
5847
/**
5948
* @public
6049
* Gossiped in component for the cluster time tracking the state of user databases

src/sdam/topology.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,11 @@ import {
4949
import {
5050
_advanceClusterTime,
5151
type ClusterTime,
52-
drainTimerQueue,
5352
ServerType,
5453
STATE_CLOSED,
5554
STATE_CLOSING,
5655
STATE_CONNECTED,
5756
STATE_CONNECTING,
58-
type TimerQueue,
5957
TopologyType
6058
} from './common';
6159
import {
@@ -132,8 +130,6 @@ export interface TopologyPrivate {
132130
servers: Map<string, Server>;
133131
credentials?: MongoCredentials;
134132
clusterTime?: ClusterTime;
135-
/** timers created for the initial connect to a server */
136-
connectionTimers: TimerQueue;
137133

138134
/** related to srv polling */
139135
srvPoller?: SrvPoller;
@@ -322,8 +318,6 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
322318
credentials: options?.credentials,
323319
clusterTime: undefined,
324320

325-
// timer management
326-
connectionTimers: new Set<NodeJS.Timeout>(),
327321
detectShardedTopology: ev => this.detectShardedTopology(ev),
328322
detectSrvRecords: ev => this.detectSrvRecords(ev)
329323
};
@@ -412,8 +406,6 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
412406
} finally {
413407
this.connectionLock = undefined;
414408
}
415-
416-
return this;
417409
}
418410

419411
private async _connect(options?: ConnectOptions): Promise<Topology> {
@@ -501,7 +493,6 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
501493
stateTransition(this, STATE_CLOSING);
502494

503495
drainWaitQueue(this[kWaitQueue], new MongoTopologyClosedError());
504-
drainTimerQueue(this.s.connectionTimers);
505496

506497
if (this.s.srvPoller) {
507498
this.s.srvPoller.stop();

0 commit comments

Comments
 (0)