1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-12-17 22:52:01 +01:00

Implement cache v2

This commit is contained in:
Bassem Dghaidi 2024-06-10 11:37:36 -07:00 committed by GitHub
parent f7e6edf3a0
commit 643d6d6123
4 changed files with 12 additions and 8 deletions

View file

@ -12362,17 +12362,18 @@ const core = __importStar(__nccwpck_require__(4850));
const storage_blob_1 = __nccwpck_require__(3864); const storage_blob_1 = __nccwpck_require__(3864);
function UploadCache(uploadURL, archivePath) { function UploadCache(uploadURL, archivePath) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
core.debug(`Uploading cache to: ${uploadURL}`); core.info(`Uploading ${archivePath} to: ${uploadURL}`);
// Specify data transfer options // Specify data transfer options
const uploadOptions = { const uploadOptions = {
blockSize: 4 * 1024 * 1024, blockSize: 4 * 1024 * 1024,
concurrency: 2, concurrency: 2,
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size 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: BlobClient = new BlobClient(uploadURL.urls[0])
const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url); const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url);
const blockBlobClient = blobClient.getBlockBlobClient(); const blockBlobClient = blobClient.getBlockBlobClient();
core.info(`BlobClient: ${blobClient}`);
core.info(`BlobClient: ${blockBlobClient}`);
return blockBlobClient.uploadFile(archivePath, uploadOptions); return blockBlobClient.uploadFile(archivePath, uploadOptions);
}); });
} }

View file

@ -12362,17 +12362,18 @@ const core = __importStar(__nccwpck_require__(4850));
const storage_blob_1 = __nccwpck_require__(3864); const storage_blob_1 = __nccwpck_require__(3864);
function UploadCache(uploadURL, archivePath) { function UploadCache(uploadURL, archivePath) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
core.debug(`Uploading cache to: ${uploadURL}`); core.info(`Uploading ${archivePath} to: ${uploadURL}`);
// Specify data transfer options // Specify data transfer options
const uploadOptions = { const uploadOptions = {
blockSize: 4 * 1024 * 1024, blockSize: 4 * 1024 * 1024,
concurrency: 2, concurrency: 2,
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size 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: BlobClient = new BlobClient(uploadURL.urls[0])
const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url); const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url);
const blockBlobClient = blobClient.getBlockBlobClient(); const blockBlobClient = blobClient.getBlockBlobClient();
core.info(`BlobClient: ${blobClient}`);
core.info(`BlobClient: ${blockBlobClient}`);
return blockBlobClient.uploadFile(archivePath, uploadOptions); return blockBlobClient.uploadFile(archivePath, uploadOptions);
}); });
} }

View file

@ -12362,17 +12362,18 @@ const core = __importStar(__nccwpck_require__(4850));
const storage_blob_1 = __nccwpck_require__(3864); const storage_blob_1 = __nccwpck_require__(3864);
function UploadCache(uploadURL, archivePath) { function UploadCache(uploadURL, archivePath) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
core.debug(`Uploading cache to: ${uploadURL}`); core.info(`Uploading ${archivePath} to: ${uploadURL}`);
// Specify data transfer options // Specify data transfer options
const uploadOptions = { const uploadOptions = {
blockSize: 4 * 1024 * 1024, blockSize: 4 * 1024 * 1024,
concurrency: 2, concurrency: 2,
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size 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: BlobClient = new BlobClient(uploadURL.urls[0])
const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url); const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url);
const blockBlobClient = blobClient.getBlockBlobClient(); const blockBlobClient = blobClient.getBlockBlobClient();
core.info(`BlobClient: ${blobClient}`);
core.info(`BlobClient: ${blockBlobClient}`);
return blockBlobClient.uploadFile(archivePath, uploadOptions); return blockBlobClient.uploadFile(archivePath, uploadOptions);
}); });
} }

5
dist/save/index.js vendored
View file

@ -12362,17 +12362,18 @@ const core = __importStar(__nccwpck_require__(4850));
const storage_blob_1 = __nccwpck_require__(3864); const storage_blob_1 = __nccwpck_require__(3864);
function UploadCache(uploadURL, archivePath) { function UploadCache(uploadURL, archivePath) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
core.debug(`Uploading cache to: ${uploadURL}`); core.info(`Uploading ${archivePath} to: ${uploadURL}`);
// Specify data transfer options // Specify data transfer options
const uploadOptions = { const uploadOptions = {
blockSize: 4 * 1024 * 1024, blockSize: 4 * 1024 * 1024,
concurrency: 2, concurrency: 2,
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size 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: BlobClient = new BlobClient(uploadURL.urls[0])
const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url); const blobClient = new storage_blob_1.BlobClient(uploadURL.urls[0].url);
const blockBlobClient = blobClient.getBlockBlobClient(); const blockBlobClient = blobClient.getBlockBlobClient();
core.info(`BlobClient: ${blobClient}`);
core.info(`BlobClient: ${blockBlobClient}`);
return blockBlobClient.uploadFile(archivePath, uploadOptions); return blockBlobClient.uploadFile(archivePath, uploadOptions);
}); });
} }