mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
add: hDelete on LocalCache
This commit is contained in:
parent
9a6d4a8e44
commit
0ad330bdb3
17
src/cache/localcache.ts
vendored
17
src/cache/localcache.ts
vendored
@ -80,8 +80,19 @@ export class LocalCache implements ICache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async hDelete() {
|
async hDelete(key: string, field: string) {
|
||||||
console.log('hDelete not implemented');
|
try {
|
||||||
return 0;
|
const data = LocalCache.localCache.get(this.buildKey(key)) as Object;
|
||||||
|
|
||||||
|
if (data && field in data) {
|
||||||
|
delete data[field];
|
||||||
|
LocalCache.localCache.set(key, data);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
} catch (error) {
|
||||||
|
this.logger.error(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user