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