1
0
Fork 0
mirror of https://github.com/rharkor/caching-for-turbo.git synced 2025-06-09 09:35:17 +09:00
This commit is contained in:
rharkor 2025-04-10 15:20:50 +02:00
parent fd07872c66
commit 883aaa7a2a
3 changed files with 27 additions and 22 deletions

13
dist/setup/index.js generated vendored
View file

@ -196618,6 +196618,7 @@ var lib_storage_dist_cjs = __nccwpck_require__(22358);
const getS3Provider = () => {
const s3AccessKeyId = core.getInput('s3-access-key-id');
const s3SecretAccessKey = core.getInput('s3-secret-access-key');
@ -196640,14 +196641,8 @@ const getS3Provider = () => {
secretAccessKey: s3SecretAccessKey
}
});
const getObjectKey = (hash, tag) => {
if (tag) {
return `${s3Prefix}${hash}#${tag}`;
}
return `${s3Prefix}${hash}`;
};
const save = async (ctx, hash, tag, stream) => {
const objectKey = getObjectKey(hash, tag);
const objectKey = getCacheKey(hash, tag);
try {
// Use the S3 Upload utility which handles multipart uploads for large files
const upload = new lib_storage_dist_cjs.Upload({
@ -196669,7 +196664,7 @@ const getS3Provider = () => {
};
const get = async (ctx, hash) => {
// First try to get with just the hash
const objectKey = getObjectKey(hash);
const objectKey = getCacheKey(hash);
try {
// Try to find the object
const listCommand = new dist_cjs.ListObjectsV2Command({
@ -196725,7 +196720,7 @@ const getS3Provider = () => {
try {
const deleteCommand = new dist_cjs.DeleteObjectCommand({
Bucket: s3Bucket,
Key: hash.startsWith(s3Prefix) ? hash : getObjectKey(hash)
Key: getCacheKey(hash)
});
await s3Client.send(deleteCommand);
}

2
dist/setup/index.js.map generated vendored

File diff suppressed because one or more lines are too long