pnxtech / hydra

A light-weight library for building distributed applications such as microservices
https://www.hydramicroservice.com
MIT License
645 stars 54 forks source link

pass options through to redis duplicate call #209

Closed emadum closed 5 years ago

emadum commented 5 years ago

This PR passes the options argument through to node_redis's duplicate call. In this case, I need to pass {detect_buffers: true} on the cloned connection to make proper use of the DUMP/RESTORE Redis commands.

This is something that would not be necessary if we migrated Hydra to ioredis, which has a more elegant API for handling buffers.

We should probably also add the callback argument, to allow maximum flexibility, which if present uses a non-blocking version of the call.