adonis-cache icon indicating copy to clipboard operation
adonis-cache copied to clipboard

file driver cache hashing does not work

Open Kuisaa opened this issue 2 years ago • 2 comments

If I use "file" cache driver the cache gets named [object Promise].cache and by awaiting the key hashing I get different key each time, so using get or has etc. will result in error, since the file named after the hashed key cannot exist.

Kuisaa avatar Dec 08 '22 14:12 Kuisaa

i'm facing this problem too, any solution ?

nautonk avatar Jan 02 '23 07:01 nautonk

  • Hash.make is a async method, but in FileCache.ts it called without a await
    private hashKey(key: string) {
        return this.hash.make(key + '')
    }
    
  • There is a lot of synchronous file API call
  • The testing was lacking

this file cache driver is not ready for production usage

shiny avatar May 06 '23 11:05 shiny