-
Notifications
You must be signed in to change notification settings - Fork 113
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
♻ refactor(IDistributedCache): Optimize connections under Isolation and Attempt to reconnect #740
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
|
||
namespace Masa.BuildingBlocks.Caching; | ||
|
||
internal class DistributedCacheClientCache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DistributedCacheClientCache的后缀Cache是OK的吗?你这是个工厂吧,改成ClientFactory?
{ | ||
public static ConcurrentDictionary<string, IManualDistributedCacheClient> CacheClients { get; set; } = new(); | ||
|
||
public IManualDistributedCacheClient GetCacheClient(IServiceProvider serviceProvider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IHttpClientFactory用的时CreateClient,要对其它吗?
return _connection.GetDatabase(); | ||
|
||
throw new NotSupportedException("Redis service has been disconnected, please wait for reconnection and try again"); | ||
return EnsureDbConnection(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnsureABC方法一般是返回void,里面可以抛异常。大概是这样:
EnsureABC();
return _connect.GetDatabase();
No description provided.