Merge pull request #4020 from knorrium/fix_rate_limiting

Fix rate limiting when syncing assets on CI
This commit is contained in:
softsimon
2023-07-21 21:11:41 +09:00
committed by GitHub
2 changed files with 24 additions and 0 deletions

View File

@@ -26,6 +26,8 @@ try {
}
}
const githubSecret = process.env.GITHUB_TOKEN;
function download(filename, url) {
https.get(url, (response) => {
if (response.statusCode < 200 || response.statusCode > 299) {
@@ -55,6 +57,12 @@ function downloadMiningPoolLogos$() {
headers: {'user-agent': 'node.js'}
};
if (githubSecret) {
console.log('Downloading the mining pool logos with authentication');
options.headers['authorization'] = `Bearer ${githubSecret}`;
options.headers['X-GitHub-Api-Version'] = '2022-11-28';
}
https.get(options, (response) => {
const chunks_of_data = [];
@@ -109,6 +117,13 @@ function downloadPromoVideoSubtiles$() {
headers: {'user-agent': 'node.js'}
};
if (githubSecret) {
console.log('Downloading the promo video subtitles with authentication');
options.headers['authorization'] = `Bearer ${githubSecret}`;
options.headers['X-GitHub-Api-Version'] = '2022-11-28';
}
https.get(options, (response) => {
const chunks_of_data = [];
@@ -163,6 +178,12 @@ function downloadPromoVideo$() {
headers: {'user-agent': 'node.js'}
};
if (githubSecret) {
console.log('Downloading the promo videos with authentication');
options.headers['authorization'] = `Bearer ${githubSecret}`;
options.headers['X-GitHub-Api-Version'] = '2022-11-28';
}
https.get(options, (response) => {
const chunks_of_data = [];