Skip to content

Commit

Permalink
*: bump cache version to 3.2.131
Browse files Browse the repository at this point in the history
  • Loading branch information
adityamaru committed Jul 5, 2024
1 parent 379cf05 commit 15dd474
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
15 changes: 9 additions & 6 deletions dist/cleanup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ function reportFailure() {
return __awaiter(this, void 0, void 0, function* () {
try {
core.info('Reporting failure to api.blacksmith.sh');
const message = `${process.env.GITHUB_JOB} failed for ${process.env.GITHUB_REPOSITORY} with run ID: ${process.env.GITHUB_RUN_ID}; Sender: ${process.env.GITHUB_TRIGGERING_ACTOR}`;
const httpClient = (0, cacheHttpClient_1.createHttpClient)();
yield promiseWithTimeout(10000, httpClient.postJson((0, cacheHttpClient_1.getCacheApiUrl)('report-failed'), {}));
yield promiseWithTimeout(10000, httpClient.postJson((0, cacheHttpClient_1.getCacheApiUrl)('report-failed'), {
message
}));
}
catch (error) {
core.warning('Failed to report failure to api.blacksmith.sh');
Expand Down Expand Up @@ -1281,7 +1284,7 @@ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options
progress = new DownloadProgress(length);
progress.startDisplayTimer();
const downloads = [];
const blockSize = 3 * 1024 * 1024;
const blockSize = 2 * 1024 * 1024;
for (let offset = 0; offset < length; offset += blockSize) {
const count = Math.min(blockSize, length - offset);
downloads.push({
Expand Down Expand Up @@ -1312,7 +1315,7 @@ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options
while ((nextDownload = downloads.pop())) {
activeDownloads[nextDownload.offset] = nextDownload.promiseGetter();
actives++;
if (actives >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 10)) {
if (actives >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 12)) {
yield waitAndWrite();
}
}
Expand All @@ -1334,11 +1337,11 @@ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options
exports.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent;
function downloadSegmentRetry(httpClient, archiveLocation, offset, count) {
return __awaiter(this, void 0, void 0, function* () {
const retries = 3;
const retries = 5;
let failures = 0;
while (true) {
try {
const timeout = 10000;
const timeout = 15000;
const result = yield promiseWithTimeout(timeout, downloadSegment(httpClient, archiveLocation, offset, count));
if (typeof result === 'string') {
throw new Error('downloadSegmentRetry failed due to timeout');
Expand All @@ -1351,7 +1354,7 @@ function downloadSegmentRetry(httpClient, archiveLocation, offset, count) {
}
failures++;
// Jitter a bit before retrying
yield new Promise(resolve => setTimeout(resolve, Math.random() * 1000));
yield new Promise(resolve => setTimeout(resolve, Math.random() * 300));
core.info(`Retrying download segment ${offset} of ${count} (${failures} of ${retries})`);
}
}
Expand Down
15 changes: 9 additions & 6 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ function reportFailure() {
return __awaiter(this, void 0, void 0, function* () {
try {
core.info('Reporting failure to api.blacksmith.sh');
const message = `${process.env.GITHUB_JOB} failed for ${process.env.GITHUB_REPOSITORY} with run ID: ${process.env.GITHUB_RUN_ID}; Sender: ${process.env.GITHUB_TRIGGERING_ACTOR}`;
const httpClient = (0, cacheHttpClient_1.createHttpClient)();
yield promiseWithTimeout(10000, httpClient.postJson((0, cacheHttpClient_1.getCacheApiUrl)('report-failed'), {}));
yield promiseWithTimeout(10000, httpClient.postJson((0, cacheHttpClient_1.getCacheApiUrl)('report-failed'), {
message
}));
}
catch (error) {
core.warning('Failed to report failure to api.blacksmith.sh');
Expand Down Expand Up @@ -1281,7 +1284,7 @@ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options
progress = new DownloadProgress(length);
progress.startDisplayTimer();
const downloads = [];
const blockSize = 3 * 1024 * 1024;
const blockSize = 2 * 1024 * 1024;
for (let offset = 0; offset < length; offset += blockSize) {
const count = Math.min(blockSize, length - offset);
downloads.push({
Expand Down Expand Up @@ -1312,7 +1315,7 @@ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options
while ((nextDownload = downloads.pop())) {
activeDownloads[nextDownload.offset] = nextDownload.promiseGetter();
actives++;
if (actives >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 10)) {
if (actives >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 12)) {
yield waitAndWrite();
}
}
Expand All @@ -1334,11 +1337,11 @@ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options
exports.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent;
function downloadSegmentRetry(httpClient, archiveLocation, offset, count) {
return __awaiter(this, void 0, void 0, function* () {
const retries = 3;
const retries = 5;
let failures = 0;
while (true) {
try {
const timeout = 10000;
const timeout = 15000;
const result = yield promiseWithTimeout(timeout, downloadSegment(httpClient, archiveLocation, offset, count));
if (typeof result === 'string') {
throw new Error('downloadSegmentRetry failed due to timeout');
Expand All @@ -1351,7 +1354,7 @@ function downloadSegmentRetry(httpClient, archiveLocation, offset, count) {
}
failures++;
// Jitter a bit before retrying
yield new Promise(resolve => setTimeout(resolve, Math.random() * 1000));
yield new Promise(resolve => setTimeout(resolve, Math.random() * 300));
core.info(`Retrying download segment ${offset} of ${count} (${failures} of ${retries})`);
}
}
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "npm:@useblacksmith/[email protected].125",
"@actions/cache": "npm:@useblacksmith/[email protected].131",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.4",
"@actions/glob": "^0.4.0",
Expand Down

0 comments on commit 15dd474

Please sign in to comment.