Skip to content

Commit

Permalink
Bind 'this' for setInterval callback (#1165)
Browse files Browse the repository at this point in the history
Signed-off-by: Lauri Nevala <[email protected]>
  • Loading branch information
nevalla authored Oct 28, 2020
1 parent c3bde1a commit bc97f17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extensions/telemetry/src/tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export class Tracker extends Util.Singleton {
}
this.eventHandlers.push(handler)
EventBus.appEventBus.addListener(handler)

this.reportInterval = setInterval(this.reportData, 60 * 60 * 1000) // report every 1h
this.reportInterval = setInterval(() => {
this.reportData()
}, 60 * 60 * 1000) // report every 1h
}

stop() {
Expand Down

0 comments on commit bc97f17

Please sign in to comment.