ITADN

Incompatability with Redis + Sializer (Get returns String)

#190Closedkinsi55 创建于 2023-08-28
K
kinsi55commented
I'm trying to use `@keyvhq/redis` with `sializer` as the De/Serializer. Heres the Keyv options I use: `{ store: new (require("@keyvhq/redis"))(REDISURL), serialize: sia, deserialize: desia }` The Problem now lies in the fact that when .get is called, a String will be passed to the deserialize method (https://github.com/microlinkhq/keyvhq/blob/bfe4f4f21da3b1ca7aa798b0f3bd6eea347030fe/packages/core/src/index.js#L59-L63) which in term causes the Desia Method to break. My current workaround is changing the deserialize method to be this instead: `x => desia(Buffer.from(x))` Obviously this isnt super great, and I think a better solution would be having a new option which in term skips the redis > buffer > string conversion and just works with the buffer to begin with (I'm assuming here that thats what happens, I havent looked into it further) **Edit:** Looks like my workaround doesnt consistently work.
关闭于 2023-08-28 3 条评论