fix(core): update

This commit is contained in:
2023-07-21 00:44:39 +02:00
parent fcaed1a3a0
commit 45122024fc
8 changed files with 211 additions and 162 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/levelcache',
version: '3.0.5',
version: '3.0.6',
description: 'a cache that uses memory/disk/s3 as backup'
}

View File

@ -14,7 +14,7 @@ export class CacheRouter {
/**
* gets the relevant cache to perform a store action on
*/
async getCacheForStoreAction (keyArg: string, cacheEntry: CacheEntry): Promise<AbstractCache> {
async getCacheForStoreAction(keyArg: string, cacheEntry: CacheEntry): Promise<AbstractCache> {
let returnCache: AbstractCache;
const mbToBytesMultiplier = 1000 * 1000;
const maxMemoryBytes = this.levelCacheRef.options.maxMemoryStorageInMB * mbToBytesMultiplier;
@ -47,7 +47,7 @@ export class CacheRouter {
/**
* gets the relevant cache to perform a retrieval action on
*/
async getCacheForRetrieveAction (keyArg: string): Promise<AbstractCache> {
async getCacheForRetrieveAction(keyArg: string): Promise<AbstractCache> {
const done = plugins.smartpromise.defer<AbstractCache>();
const returnCache = this.cacheKeyMap.getByKey(keyArg);
if (!returnCache && this.levelCacheRef.options.persistentCache) {

View File

@ -46,7 +46,7 @@ export class LevelCache extends AbstractCache {
maxMemoryStorageInMB: 0.5,
maxDiskStorageInMB: 10,
maxS3StorageInMB: 50,
...optionsArg
...optionsArg,
};
this.init();
}