Commit 2e12cb23 authored by nanahira's avatar nanahira

run together

parent 62bc9ad4
Pipeline #206 passed with stages
in 1 minute and 23 seconds
...@@ -7,6 +7,7 @@ const fetcher = new Tx3Fetcher(); ...@@ -7,6 +7,7 @@ const fetcher = new Tx3Fetcher();
async function runServer(server: string) { async function runServer(server: string) {
const users = await fetcher.fetchUsersFromServer(server); const users = await fetcher.fetchUsersFromServer(server);
await fs.promises.writeFile(`./output/servers/${server}.json`, JSON.stringify(users, null, 2)); await fs.promises.writeFile(`./output/servers/${server}.json`, JSON.stringify(users, null, 2));
return users;
} }
async function main() { async function main() {
...@@ -18,8 +19,11 @@ async function main() { ...@@ -18,8 +19,11 @@ async function main() {
}); });
} }
await fetcher.initProxies(); await fetcher.initProxies();
for (let server of servers) { const userListWithServer = await Promise.all(servers.map(runServer));
await runServer(server); const allServersList: any = {};
for (let i = 0; i < servers.length;++i) {
allServersList[servers[i]] = userListWithServer[i];
} }
await fs.promises.writeFile(`./output/all.json`, JSON.stringify(allServersList, null, 2));
} }
main(); main();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment