Skip to content

fix!: remove dialler language #2085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 autoDial: 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 (autoDial != null) {
autoDial.stop()
}
})

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

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

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

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

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

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

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

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

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

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

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

void autoDialler.autoDial()
void autoDial.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 autoDial.autoDial()

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