Skip to content

Commit

Permalink
delete old mmstats code
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Nov 30, 2023
1 parent 819a449 commit 89ab5cf
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 62 deletions.
1 change: 0 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const defaults = {
COOKIE_DOMAIN: "", // domain to use for the cookie. Use e.g. '.opendota.com' to share cookie across subdomains
UNTRACK_DAYS: 30, // The number of days a user is tracked for after every visit
GOAL: 5, // The cheese goal
MMSTATS_DATA_INTERVAL: 3, // minutes between requests for MMStats data
DEFAULT_DELAY: 1000, // delay between API requests
SCANNER_DELAY: 2000, // delay for scanner API requests (stricter rate limit)
MMR_PARALLELISM: 10, // Number of simultaneous MMR requests to make (per retriever)
Expand Down
11 changes: 0 additions & 11 deletions svc/mmstats.js

This file was deleted.

20 changes: 0 additions & 20 deletions svc/retriever.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,6 @@ function getSentryHashKey(user) {
return Buffer.from(`retriever:sentry:${user}`);
}

function getMMStats(idx, cb) {
steamObj[idx].Dota2.requestMatchmakingStats();
steamObj[idx].Dota2.once(
"matchmakingStatsData",
(waitTimes, searchingPlayers, disabledGroups) => {
if (disabledGroups) {
cb(null, disabledGroups.legacy_searching_players_by_group_source2);
} else {
cb("error mmstats");
}
}
);
}

function getPlayerProfile(idx, accountId, cb) {
accountId = Number(accountId);
const { Dota2 } = steamObj[idx];
Expand Down Expand Up @@ -527,12 +513,6 @@ app.use((req, res, cb) => {
app.get("/", (req, res, cb) => {
const keys = Object.keys(steamObj);
const rKey = keys[Math.floor(Math.random() * keys.length)];
if (req.query.mmstats) {
return getMMStats(rKey, (err, data) => {
res.locals.data = data;
return cb(err);
});
}
if (req.query.match_id) {
// Don't allow requests coming in too fast
const curRequestTime = new Date();
Expand Down
4 changes: 2 additions & 2 deletions util/getGcData.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function getGcDataFromRetriever(match, cb) {
);
return getData(
{ url: urls, noRetry: match.noRetry, timeout: 5000 },
async (err, body, metadata) => {
async (err, body) => {
if (
err ||
!body ||
Expand All @@ -37,7 +37,7 @@ async function getGcDataFromRetriever(match, cb) {
}
// Count retriever calls
redisCount(redis, "retriever");
redis.zincrby("retrieverCounts", 1, metadata.hostname);
redis.zincrby("retrieverCounts", 1, 'retriever');
redis.expireat(
"retrieverCounts",
moment().startOf("hour").add(1, "hour").format("X")
Expand Down
25 changes: 0 additions & 25 deletions util/getMMStats.js

This file was deleted.

4 changes: 1 addition & 3 deletions util/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,7 @@ function getData(url, cb) {
return getData(url, cb);
}
}
return cb(null, body, {
hostname: parse.host,
});
return cb(null, body);
}
);
}, delay);
Expand Down

0 comments on commit 89ab5cf

Please sign in to comment.