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: Stop crashing when redis is offline and ignoreErrors on cache op… #8725

Merged
merged 2 commits into from Mar 26, 2022

Conversation

mesinger
Copy link
Contributor

@mesinger mesinger commented Mar 3, 2022

Description of change

PR #7630 introduced the ignoreErrors flag for ConnectionOptions. For me this updated did not fix my problem (also mentioned in the same PR #7630).
From my subjective opinion, typeorm should still function even though redis caching is not available. typeorm will be able to query like regular from the database overall increasing the resilience of systems using typeorm.

This fix adds an error callback for the internally used redis client, logging instead of throwing an error when ignoreErrors is set.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

@mesinger mesinger force-pushed the fix/redis-crash-when-offline branch from f50c4ab to 72c836d Compare March 6, 2022 16:52
@mesinger mesinger requested a review from Ginden March 10, 2022 13:01
@pleerock pleerock merged commit edc39d1 into typeorm:master Mar 26, 2022
@pleerock
Copy link
Member

Thank you for contribution! 🎉

M-TGH pushed a commit to TradeCast/typeorm that referenced this pull request Mar 29, 2022
…tions is set (typeorm#8725)

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
@Juantrix123
Copy link

This PR introduces an error in RedisQueryResultCache class, since the connect method of the redis client is not called.
This causes (ClientClosedError: The client is closed) when cache is used

@mesinger
Copy link
Contributor Author

You are right, should be fixed here #8894

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants