mirror of
https://gitee.com/actions-mirror/cache.git
synced 2024-11-27 04:50:43 +08:00
Implement cache v2
This commit is contained in:
parent
f7e6edf3a0
commit
643d6d6123
5
dist/restore-only/index.js
vendored
5
dist/restore-only/index.js
vendored
@ -12362,17 +12362,18 @@ const core = __importStar(__nccwpck_require__(4850));
|
||||
const storage_blob_1 = __nccwpck_require__(3864);
|
||||
function UploadCache(uploadURL, archivePath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug(`Uploading cache to: ${uploadURL}`);
|
||||
core.info(`Uploading ${archivePath} to: ${uploadURL}`);
|
||||
// Specify data transfer options
|
||||
const uploadOptions = {
|
||||
blockSize: 4 * 1024 * 1024,
|
||||
concurrency: 2,
|
||||
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size
|
||||
};
|
||||
// Create blob client from container client
|
||||
// const blobClient: BlobClient = new BlobClient(uploadURL.urls[0])
|
||||
const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url);
|
||||
const blockBlobClient = blobClient.getBlockBlobClient();
|
||||
core.info(`BlobClient: ${blobClient}`);
|
||||
core.info(`BlobClient: ${blockBlobClient}`);
|
||||
return blockBlobClient.uploadFile(archivePath, uploadOptions);
|
||||
});
|
||||
}
|
||||
|
5
dist/restore/index.js
vendored
5
dist/restore/index.js
vendored
@ -12362,17 +12362,18 @@ const core = __importStar(__nccwpck_require__(4850));
|
||||
const storage_blob_1 = __nccwpck_require__(3864);
|
||||
function UploadCache(uploadURL, archivePath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug(`Uploading cache to: ${uploadURL}`);
|
||||
core.info(`Uploading ${archivePath} to: ${uploadURL}`);
|
||||
// Specify data transfer options
|
||||
const uploadOptions = {
|
||||
blockSize: 4 * 1024 * 1024,
|
||||
concurrency: 2,
|
||||
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size
|
||||
};
|
||||
// Create blob client from container client
|
||||
// const blobClient: BlobClient = new BlobClient(uploadURL.urls[0])
|
||||
const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url);
|
||||
const blockBlobClient = blobClient.getBlockBlobClient();
|
||||
core.info(`BlobClient: ${blobClient}`);
|
||||
core.info(`BlobClient: ${blockBlobClient}`);
|
||||
return blockBlobClient.uploadFile(archivePath, uploadOptions);
|
||||
});
|
||||
}
|
||||
|
5
dist/save-only/index.js
vendored
5
dist/save-only/index.js
vendored
@ -12362,17 +12362,18 @@ const core = __importStar(__nccwpck_require__(4850));
|
||||
const storage_blob_1 = __nccwpck_require__(3864);
|
||||
function UploadCache(uploadURL, archivePath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug(`Uploading cache to: ${uploadURL}`);
|
||||
core.info(`Uploading ${archivePath} to: ${uploadURL}`);
|
||||
// Specify data transfer options
|
||||
const uploadOptions = {
|
||||
blockSize: 4 * 1024 * 1024,
|
||||
concurrency: 2,
|
||||
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size
|
||||
};
|
||||
// Create blob client from container client
|
||||
// const blobClient: BlobClient = new BlobClient(uploadURL.urls[0])
|
||||
const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url);
|
||||
const blockBlobClient = blobClient.getBlockBlobClient();
|
||||
core.info(`BlobClient: ${blobClient}`);
|
||||
core.info(`BlobClient: ${blockBlobClient}`);
|
||||
return blockBlobClient.uploadFile(archivePath, uploadOptions);
|
||||
});
|
||||
}
|
||||
|
5
dist/save/index.js
vendored
5
dist/save/index.js
vendored
@ -12362,17 +12362,18 @@ const core = __importStar(__nccwpck_require__(4850));
|
||||
const storage_blob_1 = __nccwpck_require__(3864);
|
||||
function UploadCache(uploadURL, archivePath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug(`Uploading cache to: ${uploadURL}`);
|
||||
core.info(`Uploading ${archivePath} to: ${uploadURL}`);
|
||||
// Specify data transfer options
|
||||
const uploadOptions = {
|
||||
blockSize: 4 * 1024 * 1024,
|
||||
concurrency: 2,
|
||||
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size
|
||||
};
|
||||
// Create blob client from container client
|
||||
// const blobClient: BlobClient = new BlobClient(uploadURL.urls[0])
|
||||
const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url);
|
||||
const blockBlobClient = blobClient.getBlockBlobClient();
|
||||
core.info(`BlobClient: ${blobClient}`);
|
||||
core.info(`BlobClient: ${blockBlobClient}`);
|
||||
return blockBlobClient.uploadFile(archivePath, uploadOptions);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user