Skip to content

Commit

Permalink
fix: infinite loop in listeners index
Browse files Browse the repository at this point in the history
  • Loading branch information
edumudu committed Jan 28, 2021
1 parent 5c81b5f commit 48adc13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/listeners/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default (io: Server, socket: Socket, gameManager: GameManager) => {
}

files.map(fileName => {
if(fileName !== 'index.ts') {
if(!/index.[j,t]s/.test(fileName)) {
console.debug(`Initializing listener at: ${fileName}`);
// Requires all the files in the directory that is not a index.js.
const listener: (io: Server, socket: Socket, gameManager: GameManager) => void = require(resolve(__dirname, fileName)).default;
Expand Down

0 comments on commit 48adc13

Please sign in to comment.