Skip to content

Commit

Permalink
feat: 多账号分批处理
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Sep 5, 2024
1 parent 0dc8a17 commit 26e516f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions bypasscf_likeUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,16 @@ function delayClick(time) {
const loginTasks = usernames.map((username, index) => {
const password = passwords[index];
const delay = index * delayBetweenInstances;
return new Promise((resolve, reject) => {
//其实直接使用await就可以了
setTimeout(() => {
launchBrowserForUser(username, password).then(resolve).catch(reject);
}, delay);
});
return () => {
// 确保这里返回的是函数
return new Promise((resolve, reject) => {
setTimeout(() => {
launchBrowserForUser(username, password)
.then(resolve)
.catch(reject);
}, delay);
});
};
});
// 依次执行每个批次的任务
for (let i = 0; i < totalAccounts; i += maxConcurrentAccounts) {
Expand Down

0 comments on commit 26e516f

Please sign in to comment.