You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
this is for sure not an issue, just me not knowing how to use the lib correctly but not sure where to ask besides here... hope it's ok. For some reason I have no problem getting keys (gck:xxx) into Redis but cannot get queries (gcq:xxx) to be cached.
(Part of) my test code is as follows:
constNsqlCache=require('nsql-cache');constdsAdapter=require('nsql-cache-datastore');constredisStore=require('cache-manager-redis-store');const{Datastore}=require('@google-cloud/datastore');constdatastore=newDatastore();constREDISHOST=process.env.REDISHOST||'localhost';constREDISPORT=process.env.REDISPORT||6379;constcache=newNsqlCache({db: dsAdapter(datastore),stores: [{store: redisStore,host: REDISHOST,port: REDISPORT}],config: {ttl: {keys: 60*60,// 1 hourqueries: 0// infinite}},});ProviderController.list=asyncfunction(req,res){try{constproviderKey=datastore.key(['V2Provider','04cb463f-e567-41da-810c-6b918b0130a1']);constquery=datastore.createQuery('V2Provider');awaitdatastore.get(providerKey);// works fine, stored in Redis DBconst[provs]=awaitdatastore.runQuery(query);//query runs fine but nothing stored in Redis :-(console.log(provs.length);//60 or so objects, not too much...res.send({testrun:'ok'});}catch(error){console.log(error);}};
I've been through all documentation (afaik) but cannot find what is missing here, so any help would be appreciated!
The text was updated successfully, but these errors were encountered:
Hi,
this is for sure not an issue, just me not knowing how to use the lib correctly but not sure where to ask besides here... hope it's ok. For some reason I have no problem getting keys (gck:xxx) into Redis but cannot get queries (gcq:xxx) to be cached.
(Part of) my test code is as follows:
I've been through all documentation (afaik) but cannot find what is missing here, so any help would be appreciated!
The text was updated successfully, but these errors were encountered: