Skip to content

Commit

Permalink
fix interval id type
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Oct 2, 2023
1 parent 50df0e4 commit a61c198
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class SeaportGossipNode {
public metrics?: SeaportGossipMetrics

private nextReqId = 0
private revalidateInterval?: NodeJS.Timer
private revalidateIntervalId?: ReturnType<typeof setInterval>

constructor(opts: SeaportGossipNodeOpts = {}) {
this.opts = Object.freeze({ ...seaportGossipNodeDefaultOpts, ...opts })
Expand Down Expand Up @@ -235,7 +235,7 @@ export class SeaportGossipNode {
this.seaportListener.start()
await this.ingestor?.start()

this.revalidateInterval = setInterval(async () => {
this.revalidateIntervalId = setInterval(async () => {
await this._validateStaleOrders()
}, this.opts.revalidateInterval * 1000)

Expand All @@ -255,7 +255,7 @@ export class SeaportGossipNode {
public async stop() {
if (!this.running) return
this.logger.info('Node stopping...')
clearInterval(this.revalidateInterval)
clearInterval(this.revalidateIntervalId)
this.ingestor?.stop()
this.seaportListener.stop()
this._removeListeners()
Expand Down

0 comments on commit a61c198

Please sign in to comment.