Move banchunk array away from global scope
This commit is contained in:
parent
039cab7b00
commit
3fe35a435a
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -5,7 +5,6 @@ const WS = require('ws');
|
|||
const Config = require('./config.json');
|
||||
|
||||
const clients = [];
|
||||
const banChunks = [];
|
||||
const pingInterval = 120e3;
|
||||
let lastIndex = 0;
|
||||
const uuidRegex = /[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}/i;
|
||||
|
@ -63,6 +62,7 @@ const runList = async (listData, listID, channel) => {
|
|||
const banArr = listData.split('\n');
|
||||
|
||||
if (banArr.length > Config.MaxChunkSize) {
|
||||
const banChunks = [];
|
||||
while (banArr.length > 0) {
|
||||
banChunks.push(banArr.splice(0, Config.MaxChunkSize));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue