Skip to content

Commit

Permalink
Add workaround for undefined performance in some node installations
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed Jun 15, 2023
1 parent 662c5cd commit 1076328
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { EventEmitter } from "eventemitter3";
import { Speed } from "./types";
import { trace } from "./trace";

global.performance = global.performance || (Date as any);

interface Events {
start: (command: string, pid: number) => void;
}
Expand Down
2 changes: 2 additions & 0 deletions src/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { config } from "./config";
import { GobanSocket } from "goban/src/GobanSocket";
import { trace } from "./trace";

global.performance = global.performance || (Date as any);

const MIN_CONNECT_TIME = 1000;

export const socket = new GobanSocket(config.server);
Expand Down

0 comments on commit 1076328

Please sign in to comment.