mirror of
https://github.com/actions/cache.git
synced 2024-12-28 02:05:24 +01:00
More debugging
This commit is contained in:
parent
0816faf84c
commit
577b274c51
3 changed files with 6 additions and 3 deletions
3
dist/restore/index.js
vendored
3
dist/restore/index.js
vendored
|
@ -1599,12 +1599,13 @@ function getContentRange(start, end) {
|
||||||
// }
|
// }
|
||||||
function uploadChunk(restClient, resourceUrl, data, start, end) {
|
function uploadChunk(restClient, resourceUrl, data, start, end) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
core.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start}`);
|
core.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`);
|
||||||
const requestOptions = getRequestOptions();
|
const requestOptions = getRequestOptions();
|
||||||
requestOptions.additionalHeaders = {
|
requestOptions.additionalHeaders = {
|
||||||
"Content-Type": "application/octet-stream",
|
"Content-Type": "application/octet-stream",
|
||||||
"Content-Range": getContentRange(start, end)
|
"Content-Range": getContentRange(start, end)
|
||||||
};
|
};
|
||||||
|
core.debug(`Resource URL: ${resourceUrl}`);
|
||||||
return yield restClient.uploadStream("PATCH", resourceUrl, data, requestOptions);
|
return yield restClient.uploadStream("PATCH", resourceUrl, data, requestOptions);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
3
dist/save/index.js
vendored
3
dist/save/index.js
vendored
|
@ -1599,12 +1599,13 @@ function getContentRange(start, end) {
|
||||||
// }
|
// }
|
||||||
function uploadChunk(restClient, resourceUrl, data, start, end) {
|
function uploadChunk(restClient, resourceUrl, data, start, end) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
core.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start}`);
|
core.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`);
|
||||||
const requestOptions = getRequestOptions();
|
const requestOptions = getRequestOptions();
|
||||||
requestOptions.additionalHeaders = {
|
requestOptions.additionalHeaders = {
|
||||||
"Content-Type": "application/octet-stream",
|
"Content-Type": "application/octet-stream",
|
||||||
"Content-Range": getContentRange(start, end)
|
"Content-Range": getContentRange(start, end)
|
||||||
};
|
};
|
||||||
|
core.debug(`Resource URL: ${resourceUrl}`);
|
||||||
return yield restClient.uploadStream("PATCH", resourceUrl, data, requestOptions);
|
return yield restClient.uploadStream("PATCH", resourceUrl, data, requestOptions);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,13 +150,14 @@ async function uploadChunk(
|
||||||
start: number,
|
start: number,
|
||||||
end: number
|
end: number
|
||||||
): Promise<IRestResponse<void>> {
|
): Promise<IRestResponse<void>> {
|
||||||
core.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start}`);
|
core.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`);
|
||||||
const requestOptions = getRequestOptions();
|
const requestOptions = getRequestOptions();
|
||||||
requestOptions.additionalHeaders = {
|
requestOptions.additionalHeaders = {
|
||||||
"Content-Type": "application/octet-stream",
|
"Content-Type": "application/octet-stream",
|
||||||
"Content-Range": getContentRange(start, end)
|
"Content-Range": getContentRange(start, end)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
core.debug(`Resource URL: ${resourceUrl}`);
|
||||||
return await restClient.uploadStream<void>("PATCH", resourceUrl, data, requestOptions);
|
return await restClient.uploadStream<void>("PATCH", resourceUrl, data, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue