puzpuzpuz / cls-rtracer

Request Tracer - CLS-based request id generation for Express, Fastify, Koa and Hapi, batteries included
MIT License
311 stars 24 forks source link

Incompatibility with Redis Client #13

Closed npnikhil closed 5 years ago

npnikhil commented 5 years ago

Hi,

Facing Issues with cls-tracer going out of context and returning id as 'undefined' while using it with redis. There were some suggestions to use https://github.com/abhiche/cls-redis-patch. Please let me know if there is any better way to resolve this.

puzpuzpuz commented 5 years ago

@npnikhil Are you using the latest version of redis client? If it's present there, I'd suggest to try the monkey patching approach that cls-redis-patch implements.

Also I suggest you to open an issue against redis and ask maintainers to make it Async Hooks friendly.

npnikhil commented 5 years ago

Thanks, Andrey for the suggestion. Will co-ordinate with redis maintainers.