Skip to content

Commit 429bf37

Browse files
committed
add new stats lambda function url
1 parent 7a1cef0 commit 429bf37

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

  • specifyweb/frontend/js_src/lib/components/InitialContext

specifyweb/frontend/js_src/lib/components/InitialContext/stats.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,13 @@ type StatsCounts = {
1313
const stats2RequestIntervalMs = 24 * 60 * 60 * 1000;
1414
const stats2RequestKeyPrefix = 'specify7-stats2-last-request';
1515
const stats2RequestTimeoutMs = 5000;
16+
const stats2LambdaFunctionUrl = 'https://hvf3gvyu6q3f3mkf6y5xlddstq0xmuel.lambda-url.us-east-1.on.aws/';
1617

1718
function buildStatsLambdaUrl(base: string | null | undefined): string | null {
1819
if (!base) return null;
1920
let u = base.trim();
2021

2122
if (!/^https?:\/\//i.test(u)) u = `https://${u}`;
22-
23-
const hasRoute = /\/(prod|default)\/[^\s/]+/.test(u);
24-
if (!hasRoute) {
25-
const stage = 'prod';
26-
const route = 'AggrgatedSp7Stats';
27-
u = `${u.replace(/\/$/, '')}/${stage}/${route}`;
28-
}
2923
return u;
3024
}
3125

@@ -123,7 +117,7 @@ export const fetchContext = fetchSystemInfo.then(async (systemInfo) => {
123117
{ errorMode: 'silent' }
124118
).catch(softFail);
125119

126-
const lambdaUrl = buildStatsLambdaUrl(systemInfo.stats_2_url);
120+
const lambdaUrl = buildStatsLambdaUrl(stats2LambdaFunctionUrl);
127121
if (lambdaUrl) {
128122
const storageKey = buildStats2RequestKey(
129123
lambdaUrl,

0 commit comments

Comments
 (0)