mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-23 01:03:57 +08:00
v0.7.0
This commit is contained in:
parent
ef015fc7a1
commit
3b3f1ff398
4 changed files with 19 additions and 22 deletions
|
@ -132,12 +132,10 @@ export class CacheService {
|
|||
return this._client
|
||||
.putObject({
|
||||
Bucket: this._bucket,
|
||||
Key: path.join(this.getCacheFolder(), key),
|
||||
Key: path.join(this.getCacheFolder(), `${key}.tgz`),
|
||||
Body: data,
|
||||
Metadata: {
|
||||
ContentType: "text/plain",
|
||||
ContentEncoding: "gzip"
|
||||
}
|
||||
ContentType: "text/plain",
|
||||
ContentEncoding: "gzip"
|
||||
})
|
||||
.promise();
|
||||
}
|
||||
|
@ -147,7 +145,7 @@ export class CacheService {
|
|||
const response: GetObjectOutput = await this._client
|
||||
.getObject({
|
||||
Bucket: this._bucket,
|
||||
Key: path.join(this.getCacheFolder(), key)
|
||||
Key: path.join(this.getCacheFolder(), `${key}.tgz`)
|
||||
})
|
||||
.promise();
|
||||
fs.writeFileSync(savePath, response.Body);
|
||||
|
@ -166,7 +164,10 @@ export class CacheService {
|
|||
await this._client
|
||||
.headObject({
|
||||
Bucket: this._bucket,
|
||||
Key: path.join(this.getCacheFolder(), keys[i])
|
||||
Key: path.join(
|
||||
this.getCacheFolder(),
|
||||
`${keys[i]}.tgz`
|
||||
)
|
||||
})
|
||||
.promise();
|
||||
return keys[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue