question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clear all cacheKeys by hashKey

See original GitHub issue

Hello. First of thanks for this awesome lib 😃 I wanted to ask if it is somehow possible to clear all cacheKeys with the same hashKey?

I tried to use CacheClear like this:

@CacheClear({
    hashKey: (args) => `projectPermissions-${args[0]}`,
})
async clearProjectCache(projectId: string) {
  console.log('clearing cache for project', projectId);
}

but it does not clear and I need to also define a cache key like this:

@CacheClear({
    cacheKey: (args) => args[0],
    hashKey: (args) => `projectPermissions-${args[1]}`,
 })
 async clearProjectCache(userId: string, projectId: string) {
   console.log('clearing cache for project-user', projectId);
 }

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
joshuaslatecommented, Aug 7, 2020

Hey! This should be resolved in version 8.0.0, please let me know if there are any issues!

0reactions
joshuaslatecommented, Aug 10, 2020

Please try the latest tag 😬

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rails.cache.clear certain key names? - Stack Overflow
Right, but I need to delete all keys that contain a certain string in their name. For instance, all keys that have blog/post...
Read more >
cachetools — Extensible memoizing collections and ...
This function is similar to hashkey() , but arguments of different types will yield distinct cache keys. For example, typedkey(3) and typedkey(3.0) will...
Read more >
Basic CacheManager Features and Architecture
The method ClearRegion can be used to remove all keys within one region for example. The implementation of regions depends on the cache...
Read more >
CCache | API Documentation for Yii 1.1
flush : delete all values from cache. Child classes must implement the following methods: getValue · setValue · addValue · deleteValue · getValues...
Read more >
CacheEngine - Overview (Resin 4.0.s170329)
All Methods Instance Methods Abstract Methods ... remove. void remove(HashKey key, HashKey cacheKey, MnodeUpdate mnodeUpdate) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found