Skip to content

Commit

Permalink
Merge pull request #49 from edumudu/development
Browse files Browse the repository at this point in the history
fix: infinite loop in listeners index
  • Loading branch information
edumudu authored Jan 28, 2021
2 parents 9957960 + 48adc13 commit 60d71bb
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 60d71bb

Please sign in to comment.