Skip to content

refactor(heart): bind class methods and make beat async #5142

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 7 commits into from
May 4, 2022
Merged
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
Prev Previous commit
Next Next commit
fixup!: revert setTimeout for heartbeatTimer
  • Loading branch information
Joe Previte committed May 4, 2022
commit 9fca6f0d4c69e268685db633beeedef80c7567ad
8 changes: 1 addition & 7 deletions src/node/heart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ export class Heart {
if (typeof this.heartbeatTimer !== "undefined") {
clearTimeout(this.heartbeatTimer)
}
this.heartbeatTimer = setTimeout(async () => {
try {
await heartbeatTimer(this.isActive, this.beat)
} catch (error: any) {
logger.warn(error.message)
}
}, this.heartbeatInterval)
this.heartbeatTimer = setTimeout(() => heartbeatTimer(this.isActive, this.beat), this.heartbeatInterval)
}

/**
Expand Down