Skip to content

Commit 24886ce

Browse files
authored
Merge pull request #159 from Goodluckhf/join-config-fix
добавил опцию для кол-во задач в минуту на вступление
2 parents 636684c + 34bcf26 commit 24886ce

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

.env.default

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ JWT__SECRET=!jwt_secret!
33
TASK_QUEUE__TIMEOUT=120000
44
TASK_SERVER__TIMEOUT=130000
55

6+
GROUP_JOIN_TASK__ALL_USERS__PER_MINUTE=10
67
GROUP_JOIN_TASK__BG__MIN=0
78
GROUP_JOIN_TASK__BG__MAX=300
89

config/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module.exports = {
5151
max: parseInt(process.env.GROUP_JOIN_TASK__BG__MAX, 10),
5252
},
5353
allUsers: {
54+
perMinute: parseInt(process.env.GROUP_JOIN_TASK__ALL_USERS__PER_MINUTE, 10),
5455
min: parseInt(process.env.GROUP_JOIN_TASK__ALL_USERS__MIN, 10),
5556
max: parseInt(process.env.GROUP_JOIN_TASK__ALL_USERS__MAX, 10),
5657
},

services/api/vk-users/check-account/check-and-add-user-task.handler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ export class CheckAndAddUserTaskHandler implements TaskHandlerInterface {
109109
groupId,
110110
vkUserCredentials,
111111
min: 0,
112-
max: (allUsersToJoin * groupIdsForJoin.length * 60) / 20,
112+
max:
113+
(allUsersToJoin * groupIdsForJoin.length * 60) /
114+
this.config.get('groupJoinTask.allUsers.perMinute'),
113115
});
114116
},
115117
{ concurrency: 5 },

0 commit comments

Comments
 (0)