Skip to content

Commit

Permalink
Update retriever.js
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung authored Oct 2, 2023
1 parent 95ae89e commit 6d3f56c
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions svc/retriever.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const app = express();
const steamObj = {};
const minUpTimeSeconds = 120;
const timeoutMs = 1500;
const accountsToUse = 3;
const matchRequestLimit = 550;
const accountsToUse = 2;
const matchRequestLimit = 350;
const port = config.PORT || config.RETRIEVER_PORT;
const matchRequestDelay = 400;
const matchRequestDelayStep = 3;
Expand Down Expand Up @@ -401,19 +401,26 @@ function init() {
*/
},
() => {
allReady = true;
if (Object.keys(steamObj).length === 0) {
chooseLoginInfo();
init();
} else {
allReady = true;
}
}
);
}

if (config.STEAM_ACCOUNT_DATA) {
const accountData = cp
.execSync(`curl '${config.STEAM_ACCOUNT_DATA}'`, {
maxBuffer: 8 * 1024 * 1024,
})
.toString()
.split(/\r\n|\r|\n/g);
}

function chooseLoginInfo() {
if (config.STEAM_ACCOUNT_DATA) {
const accountData = cp
.execSync(`curl '${config.STEAM_ACCOUNT_DATA}'`, {
maxBuffer: 8 * 1024 * 1024,
})
.toString()
.split(/\r\n|\r|\n/g);
const startIndex = Math.floor(
Math.random() * (accountData.length - accountsToUse)
);
Expand Down

0 comments on commit 6d3f56c

Please sign in to comment.