Skip to content

Commit

Permalink
Revert "feat: Cache api schema for build (#9126)"
Browse files Browse the repository at this point in the history
This reverts commit 680c7c4.
  • Loading branch information
mjq committed Feb 15, 2024
1 parent 90a566b commit de02806
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/build/resolveOpenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const SENTRY_API_SCHEMA_SHA = '76490f725fda1363e3412c8462a95567832a68ac';

const activeEnv = process.env.GATSBY_ENV || process.env.NODE_ENV || 'development';

let cachedResonse: DeRefedOpenAPI | null = null;

async function resolveOpenAPI(): Promise<DeRefedOpenAPI> {
if (activeEnv === 'development' && process.env.OPENAPI_LOCAL_PATH) {
try {
Expand All @@ -29,16 +27,10 @@ async function resolveOpenAPI(): Promise<DeRefedOpenAPI> {
);
}
}

if (cachedResonse) {
return cachedResonse;
}
const response = await fetch(
`https://raw.githubusercontent.com/getsentry/sentry-api-schema/${SENTRY_API_SCHEMA_SHA}/openapi-derefed.json`,
{cache: 'no-store'}
`https://raw.githubusercontent.com/getsentry/sentry-api-schema/${SENTRY_API_SCHEMA_SHA}/openapi-derefed.json`
);
cachedResonse = await response.json();
return cachedResonse!;
return await response.json();
}

export type APIParameter = {
Expand Down

0 comments on commit de02806

Please sign in to comment.