Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
reinstate ten second interval between heartbeats - fixes #276
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jun 5, 2018
1 parent 087acd5 commit f6e012e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,11 @@ class Deferred {
}
}

const INTERVAL = 10000;

class DevServer {
clients: Set<http.ServerResponse>;
interval: NodeJS.Timer;
_: http.Server;

constructor(port: number, interval = 10000) {
Expand Down Expand Up @@ -385,13 +388,14 @@ class DevServer {

this._.listen(port);

setInterval(() => {
this.interval = setInterval(() => {
this.send(null);
});
}, INTERVAL);
}

close() {
this._.close();
clearInterval(this.interval);
}

send(data: any) {
Expand Down

0 comments on commit f6e012e

Please sign in to comment.