10000 Api rate limit error fix by mahabaleshwars · Pull Request #950 · actions/setup-python · GitHub
[go: up one dir, main page]

Skip to content

Api rate limit error fix #950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
intial commit
  • Loading branch information
mahabaleshwars committed Sep 23, 2024
commit c4b81dc3e7daf6768ce106d2cd1c05ea1546bb65
12 changes: 10 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91637,24 +91637,32 @@ function findReleaseFromManifest(semanticVersionSpec, architecture, manifest) {
return __awaiter(this, void 0, void 0, function* () {
if (!manifest) {
manifest = yield getManifest();
core.debug('manifest :>> ' + JSON.stringify(manifest));
}
const foundRelease = yield tc.findFromManifest(semanticVersionSpec, false, manifest, architecture);
core.debug(`Found release: ${JSON.stringify(foundRelease)}`);
return foundRelease;
});
}
exports.findReleaseFromManifest = findReleaseFromManifest;
function getManifest() {
return __awaiter(this, void 0, void 0, function* () {
try {
return yield getManifestFromRepo();
const manifestFromRepo = yield getManifestFromRepo();
core.debug('Successfully fetched the manifest from the repo.');
core.debug(`Manifest from repo: ${JSON.stringify(manifestFromRepo)}`);
return manifestFromRepo;
}
catch (err) {
core.debug('Fetching the manifest via the API failed.');
if (err instanceof Error) {
core.debug(err.message);
}
}
return yield getManifestFromURL();
const manifestFromURL = yield getManifestFromURL();
core.debug('Successfully fetched the manifest from the URL.');
core.debug(`Manifest from URL: ${JSON.stringify(manifestFromURL)}`);
return manifestFromURL;
});
}
exports.getManifest = getManifest;
Expand Down
13 changes: 10 additions & 3 deletions src/install-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export async function findReleaseFromManifest(
): Promise<tc.IToolRelease | undefined> {
if (!manifest) {
manifest = await getManifest();
core.debug('manifest :>> ' + JSON.stringify(manifest));
}

const foundRelease = await tc.findFromManifest(
Expand All @@ -28,20 +29,26 @@ export async function findReleaseFromManifest(
manifest,
architecture
);

core.debug(`Found release: ${JSON.stringify(foundRelease)}`);
return foundRelease;
}

export async function getManifest(): Promise<tc.IToolRelease[]> {
try {
return await getManifestFromRepo();
const manifestFromRepo = await getManifestFromRepo();
core.debug('Successfully fetched the manifest from the repo.');
core.debug(`Manifest from repo: ${JSON.stringify(manifestFromRepo)}`);
return manifestFromRepo;
} catch (err) {
core.debug('Fetching the manifest via the API failed.');
if (err instanceof Error) {
core.debug(err.message);
}
}
return await getManifestFromURL();
const manifestFromURL = await getManifestFromURL();
core.debug('Successfully fetched the manifest from the URL.');
core.debug(`Manifest from URL: ${JSON.stringify(manifestFromURL)}`);
return manifestFromURL;
}

export function getManifestFromRepo(): Promise<tc.IToolRelease[]> {
Expand Down
0