fix(core): Update CI workflows and dependencies; apply small bugfixes and formatting improvements
This commit is contained in:
@@ -24,15 +24,21 @@ export class CacheS3Manager extends AbstractCache {
|
||||
|
||||
public async init() {
|
||||
if (this.levelCacheRef.options.s3Config) {
|
||||
this.smartbucket = new plugins.smartbucket.SmartBucket(this.levelCacheRef.options.s3Config);
|
||||
this.smartbucket = new plugins.smartbucket.SmartBucket(
|
||||
this.levelCacheRef.options.s3Config,
|
||||
);
|
||||
this.s3CacheBucket = await this.smartbucket.getBucketByName('');
|
||||
this.s3CacheDir = await (
|
||||
await this.s3CacheBucket.getBaseDirectory()
|
||||
).getSubDirectoryByName(this.levelCacheRef.options.cacheId);
|
||||
if (this.levelCacheRef.options.maxS3StorageInMB) {
|
||||
console.log(`cache level S3 activated with ${this.levelCacheRef.options.maxS3StorageInMB}`);
|
||||
console.log(
|
||||
`cache level S3 activated with ${this.levelCacheRef.options.maxS3StorageInMB}`,
|
||||
);
|
||||
} else {
|
||||
console.log(`s3 cache started without limit. Automatically applying timebox of 1 month`);
|
||||
console.log(
|
||||
`s3 cache started without limit. Automatically applying timebox of 1 month`,
|
||||
);
|
||||
}
|
||||
this.status = 'active';
|
||||
} else {
|
||||
@@ -42,9 +48,11 @@ export class CacheS3Manager extends AbstractCache {
|
||||
}
|
||||
|
||||
public async retrieveCacheEntryByKey(keyArg: string): Promise<CacheEntry> {
|
||||
const jsonFileString = (await this.s3CacheDir.fastGet({
|
||||
path: encodeURIComponent(keyArg),
|
||||
})).toString();
|
||||
const jsonFileString = (
|
||||
await this.s3CacheDir.fastGet({
|
||||
path: encodeURIComponent(keyArg),
|
||||
})
|
||||
).toString();
|
||||
const cacheEntry = CacheEntry.fromStorageJsonString(jsonFileString);
|
||||
return cacheEntry;
|
||||
}
|
||||
@@ -52,7 +60,7 @@ export class CacheS3Manager extends AbstractCache {
|
||||
public async storeCacheEntryByKey(keyArg: string, cacheEntryArg: CacheEntry) {
|
||||
await this.s3CacheDir.fastPut({
|
||||
path: encodeURIComponent(keyArg),
|
||||
contents: cacheEntryArg.toStorageJsonString()
|
||||
contents: cacheEntryArg.toStorageJsonString(),
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user