BREAKING CHANGE(core): switch to esm
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import * as plugins from './levelcache.plugins';
|
||||
import { AbstractCache } from './levelcache.abstract.classes.cache';
|
||||
import { LevelCache } from './levelcache.classes.levelcache';
|
||||
import { CacheEntry } from './levelcache.classes.cacheentry';
|
||||
import * as plugins from './levelcache.plugins.js';
|
||||
import { AbstractCache } from './levelcache.abstract.classes.cache.js';
|
||||
import { LevelCache } from './levelcache.classes.levelcache.js';
|
||||
import { CacheEntry } from './levelcache.classes.cacheentry.js';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -26,9 +26,9 @@ export class CacheS3Manager extends AbstractCache {
|
||||
if (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
|
||||
);
|
||||
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}`);
|
||||
} else {
|
||||
@@ -65,7 +65,7 @@ export class CacheS3Manager extends AbstractCache {
|
||||
}
|
||||
|
||||
public async deleteCacheEntryByKey(keyArg: string) {
|
||||
if(this.status === 'active') {
|
||||
if (this.status === 'active') {
|
||||
await this.s3CacheDir.fastRemove(encodeURIComponent(keyArg));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user