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

'remember' method is not working correctly

Open mertgibi opened this issue 2 years ago • 0 comments
trafficstars

test1 route

public async all() {
        return await Cache.remember('saved', 60, async function () {
            return await Saved.all()
        })
    }

test2 route

public async all() {
        return await Cache.remember('users', 60, async function () {
            return await Users.all()
        })
    }

Problem: Whichever route I request first, the results from that route are also recorded in all other 'remember' methods.

Example scenario 1

  • step 1: request test1 route > result saved
  • step 2: request test2 route > result saved

Example scenario 2

  • step 1: request test2 route > result users
  • step 2: request test1 route > result users

This library is useless in its current state.

mertgibi avatar Nov 05 '23 12:11 mertgibi