Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(examples): cache-handler-redis implementation may cause error "Socket already opened" on production #61978

Merged

Conversation

AkifumiSato
Copy link
Contributor

What?

I copied the contents of cache-handler.js and tried it, and got an error "Socket already opened".
ref: caching-tools/next-shared-cache#284
It should be fixed so that it doesn't matter if it is copied.

Why?

Because Socket already opened, so a condition is needed before await client.connect().

How?

Add environment variable(process.env.REDIS_AVAILABLE) check.
ref: https://caching-tools.github.io/next-shared-cache/configuration/opt-out-cache-on-build

@AkifumiSato AkifumiSato requested review from a team as code owners February 13, 2024 08:00
@AkifumiSato AkifumiSato requested review from manovotny and molebox and removed request for a team February 13, 2024 08:00
@ijjk ijjk added the examples Issue/PR related to examples label Feb 13, 2024
@ijjk
Copy link
Member

ijjk commented Feb 13, 2024

Allow CI Workflow Run

  • approve CI run for commit: 824c1d4

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Copy link
Member

@samcx samcx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting a :pr:!

:lgtm:

@samcx samcx enabled auto-merge (squash) February 13, 2024 23:41
@samcx samcx merged commit 10599a4 into vercel:canary Feb 13, 2024
32 checks passed
@AkifumiSato AkifumiSato deleted the cache-handler-redis-exmaple-patch-socket-error branch February 14, 2024 02:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples locked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants