Skip to content

Commit

Permalink
Improved speed
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbrandsen committed Feb 14, 2024
1 parent 1f03a6e commit f36f642
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/process/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default async function processData(opts, proxyIndex) {
if (proxyIndex !== undefined) {
proxy = await getProxy(proxyIndex);
}

const dataResult = await GetRoomHistory(proxy, opts.shard, opts.room, opts.tick);
if (dataResult.status === "Success") {
const { data } = dataResult;
Expand Down Expand Up @@ -105,6 +106,9 @@ export default async function processData(opts, proxyIndex) {
};
}

opts.failed = true;
return processData(opts, proxyIndex);
return {
status: "Failed",
};
// opts.failed = true;
// return processData(opts, proxyIndex);
}
3 changes: 1 addition & 2 deletions src/requests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import processOpts from "../process/index.js";
import { GetUserData } from "../helper/users.js"

const useProxy = process.env.WEBSHARE_TOKEN !== undefined;
const maxProxyIndex = process.env.WEBSHARE_PROXYAMOUNT;

let proxyCycles = [];

Expand All @@ -28,7 +27,7 @@ export default class Requests {

if (useProxy) {
proxyCycles = [];
const proxies = Array.from({ length: maxProxyIndex }, (_, index) => proxy(cycle, index));
const proxies = Array.from({ length: 100 }, (_, index) => proxy(cycle, index));
await Promise.all(proxies);
cycle = proxyCycles;
}
Expand Down

0 comments on commit f36f642

Please sign in to comment.