Skip to content
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

✏️ Fix the typo from worekr to worker. #6

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
21 changes: 9 additions & 12 deletions src/chain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class Chain {

this.debug('Activate packet handler')

for (;;) {
for (; ;) {
try {
const packets = this.packetsToHandle.slice(0, 50) // TODO make this configurable
if (packets.length === 0) {
Expand Down Expand Up @@ -186,8 +186,7 @@ export class Chain {
)

this.info(
`Request handle packet to wallet manager. This chain - ${
timeoutPackets.length == 0 ? 0 : timeoutPackets.length + 1
`Request handle packet to wallet manager. This chain - ${timeoutPackets.length == 0 ? 0 : timeoutPackets.length + 1
}. Counterparty chain - ${counterpartyMsgs.length}`
)

Expand Down Expand Up @@ -225,7 +224,7 @@ export class Chain {

this.debug('Activate event feeder')

for (;;) {
for (; ;) {
try {
if (this.packetsToHandle.length > 1000) continue

Expand Down Expand Up @@ -265,18 +264,18 @@ export class Chain {
private async latestHeightWorker() {
// to prevent rerun
if (
(this.workers['latest_height_worekr'] ?? 0) >
(this.workers['latest_height_worker'] ?? 0) >
new Date().valueOf() - 5 * 60 * 1000
) {
return
}

this.debug('Activate latest height worekr')
this.debug('Activate latest height worker')

// TODO add websocket options
const MAX_RETRY = 10
let retried = 0
for (;;) {
for (; ;) {
try {
await this.updateLatestHeight()
this.debug(
Expand Down Expand Up @@ -307,7 +306,7 @@ export class Chain {
)
}
} finally {
this.workers['latest_height_worekr'] = new Date().valueOf()
this.workers['latest_height_worker'] = new Date().valueOf()
await delay(1000)
}
}
Expand Down Expand Up @@ -469,10 +468,8 @@ export class Chain {

if (counterpartyConnectionId !== this.counterpartyChain.connectionId) {
throw Error(
`"${this.chainId()} - ${
this.connectionId
}" is not connected with "${this.counterpartyChain.chainId()} - ${
this.counterpartyChain.connectionId
`"${this.chainId()} - ${this.connectionId
}" is not connected with "${this.counterpartyChain.chainId()} - ${this.counterpartyChain.connectionId
}"`
)
}
Expand Down