Skip to content

Commit

Permalink
fix!: remove dialler language (#2085)
Browse files Browse the repository at this point in the history
* fix!: remove dialler language

* chore: address pr comments
  • Loading branch information
wemeetagain authored Oct 9, 2023
1 parent df2153e commit 62a56b5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions packages/libp2p/src/connection-manager/dial-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ export class DialQueue {
setMaxListeners?.(Infinity, this.shutDownController.signal)
} catch {}

this.pendingDialCount = components.metrics?.registerMetric('libp2p_dialler_pending_dials')
this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dialler_in_progress_dials')
this.pendingDialCount = components.metrics?.registerMetric('libp2p_dial_queue_pending_dials')
this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dial_queue_in_progress_dials')
this.pendingDials = []

for (const [key, value] of Object.entries(init.resolvers ?? {})) {
Expand Down
40 changes: 20 additions & 20 deletions packages/libp2p/test/connection-manager/auto-dial.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type { PeerStore, Peer } from '@libp2p/interface/peer-store'
import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'

describe('auto-dial', () => {
let autoDialler: AutoDial
let autoDialer: AutoDial
let events: EventEmitter<Libp2pEvents>
let peerStore: PeerStore
let peerId: PeerId
Expand All @@ -38,8 +38,8 @@ describe('auto-dial', () => {
})

afterEach(() => {
if (autoDialler != null) {
autoDialler.stop()
if (autoDialer != null) {
autoDialer.stop()
}
})

Expand Down Expand Up @@ -73,16 +73,16 @@ describe('auto-dial', () => {
getDialQueue: []
})

autoDialler = new AutoDial({
autoDialer = new AutoDial({
peerStore,
connectionManager,
events
}, {
minConnections: 10,
autoDialInterval: 10000
})
autoDialler.start()
void autoDialler.autoDial()
autoDialer.start()
void autoDialer.autoDial()

await pWaitFor(() => {
return connectionManager.openConnection.callCount === 1
Expand Down Expand Up @@ -127,15 +127,15 @@ describe('auto-dial', () => {
getDialQueue: []
})

autoDialler = new AutoDial({
autoDialer = new AutoDial({
peerStore,
connectionManager,
events
}, {
minConnections: 10
})
autoDialler.start()
await autoDialler.autoDial()
autoDialer.start()
await autoDialer.autoDial()

await pWaitFor(() => connectionManager.openConnection.callCount === 1)
await delay(1000)
Expand Down Expand Up @@ -181,15 +181,15 @@ describe('auto-dial', () => {
}]
})

autoDialler = new AutoDial({
autoDialer = new AutoDial({
peerStore,
connectionManager,
events
}, {
minConnections: 10
})
autoDialler.start()
await autoDialler.autoDial()
autoDialer.start()
await autoDialer.autoDial()

await pWaitFor(() => connectionManager.openConnection.callCount === 1)
await delay(1000)
Expand All @@ -207,20 +207,20 @@ describe('auto-dial', () => {
getDialQueue: []
})

autoDialler = new AutoDial({
autoDialer = new AutoDial({
peerStore,
connectionManager,
events
}, {
minConnections: 10,
autoDialInterval: 10000
})
autoDialler.start()
autoDialer.start()

// call autodial twice
await Promise.all([
autoDialler.autoDial(),
autoDialler.autoDial()
autoDialer.autoDial(),
autoDialer.autoDial()
])

// should only have queried peer store once
Expand Down Expand Up @@ -258,17 +258,17 @@ describe('auto-dial', () => {
getDialQueue: []
})

autoDialler = new AutoDial({
autoDialer = new AutoDial({
peerStore,
connectionManager,
events
}, {
minConnections: 10,
autoDialPeerRetryThreshold: 2000
})
autoDialler.start()
autoDialer.start()

void autoDialler.autoDial()
void autoDialer.autoDial()

await pWaitFor(() => {
return connectionManager.openConnection.callCount === 1
Expand All @@ -282,7 +282,7 @@ describe('auto-dial', () => {
await delay(2000)

// autodial again
void autoDialler.autoDial()
void autoDialer.autoDial()

await pWaitFor(() => {
return connectionManager.openConnection.callCount === 3
Expand Down

0 comments on commit 62a56b5

Please sign in to comment.