nuxt-concierge icon indicating copy to clipboard operation
nuxt-concierge copied to clipboard

redis connection options issues

Open 0x77dev opened this issue 1 year ago • 2 comments

This issue consists of two parts

  1. When Redis connection options are specified in nuxt.config.ts, it attempts to connect to Redis during nuxt build, causing the build to block on connection retries. This can make building the app inside a Dockerfile nearly impossible. When concierge.redis is undefined it builds just fine.

  2. The current handling of NUXT_REDIS_* environment variables is not very convenient. It would be more practical to define REDIS_URL or NUXT_REDIS_URL using the redis:// URI scheme and search parameters for custom io-redis configuration.

https://github.com/genu/nuxt-concierge/blob/master/src/module.ts#L42-L44

0x77dev avatar Mar 25 '24 08:03 0x77dev

In some cases, if DNS resolves to an IPv6 address for NUXT_REDIS_HOST, it may not work because the family for io-redis is not specified. This prevents deploying the application when customizing concierge.redis, leading to infinite connection retries and never-ending builds.

To partially address this with the current env convention, adding NUXT_REDIS_IP_FAMILY to set concierge.redis.family would help.

References:

  • Similar Issue (with real-world use case where fly.io internal networking is all IPv6): https://github.com/mastodon/mastodon/issues/27043
  • io-redis DNS Lookup: https://redis.github.io/ioredis/index.html#DNSLookupFunction
  • Standalone Connection Options: https://redis.github.io/ioredis/index.html#StandaloneConnectionOptions

0x77dev avatar Mar 25 '24 08:03 0x77dev

Also, thanks for the nice project! Hopefully, it can become a popular solution for queues and scheduling in Nuxt. I've used BullMQ in several production projects, finding it reliable and battle-tested. This module offers an incredible nuxt developer experience! And just a side note: It would be cool to have both a concierge folder and its customizable sub-folder locations for adhering to per-project conventions.

0x77dev avatar Mar 25 '24 08:03 0x77dev