optimize
This commit is contained in:
parent
55fa60f13d
commit
1f15de7ca0
1 changed files with 4 additions and 3 deletions
5
site.js
5
site.js
|
@ -90,6 +90,7 @@ async function siteCollector(user, path, site, useLimit) {
|
|||
|
||||
let d = process.env.depth || 1;
|
||||
for (let i = 1; i < d; i++) {
|
||||
users = [...new Set(users)];
|
||||
for (let u of users) {
|
||||
users = users.concat(await siteCollector(u, 'following', site, true));
|
||||
}
|
||||
|
@ -117,7 +118,7 @@ async function siteCollector(user, path, site, useLimit) {
|
|||
}
|
||||
data[u] = { followers: [], following: [] };
|
||||
p.push(async function (k) {
|
||||
let j1 = await siteCollector(u, 'followers', site,inLegal);
|
||||
let j1 = await siteCollector(u, 'followers', site, inLegal);
|
||||
|
||||
data[u].followers = j1;
|
||||
console.log(`User ${u} followers fully calculated`);
|
||||
|
@ -126,7 +127,7 @@ async function siteCollector(user, path, site, useLimit) {
|
|||
}(p.length));
|
||||
|
||||
p.push(async function (k) {
|
||||
let j1 = await siteCollector(u, 'following', site,inLegal);
|
||||
let j1 = await siteCollector(u, 'following', site, inLegal);
|
||||
|
||||
data[u].following = j1;
|
||||
console.log(`User ${u} following fully calculated`);
|
||||
|
|
Loading…
Reference in a new issue