Changed the logic for creating groups of workers
This commit is contained in:
parent
ab094d1fd4
commit
a3d735ba6c
15
index.ts
15
index.ts
|
@ -421,17 +421,10 @@ const farm: () => Promise<void> = async () => {
|
|||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i != workers.length + 1; i += settings.pararels) {
|
||||
const _workers = workers.slice(i, i + settings.pararels);
|
||||
if (_workers.length != 0) {
|
||||
workersGroups.push(_workers);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (workersGroups.length != Math.ceil(workers.length / settings.pararels)) {
|
||||
logger.warn(`There is strange thing with workersGroups\n${workersGroups.length} ${Math.ceil(workers.length / settings.pararels)}`);
|
||||
for (let i = 0; i != settings.pararels; i++) {
|
||||
const startIndex=i*Math.ceil(workers.length / settings.pararels);
|
||||
const _workers = workers.slice(startIndex, startIndex+Math.ceil(workers.length / settings.pararels));
|
||||
workersGroups.push(_workers);
|
||||
}
|
||||
let pararels: Promise<void>[] = [];
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://notabug.org/minicx/hk_bot.git"
|
||||
"url": "https://git.disroot.org/minicx/hk_bot.git"
|
||||
},
|
||||
"keywords": [
|
||||
"telegram",
|
||||
|
|
Loading…
Reference in New Issue