We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在AbpRedisCache类中的重写方法TryGetValue(string key, out object value)中 按照官方AbpRedisCache类的实现逻辑,如果没有缓存key,则该方法应该将返回值设置为false,并将value设置为null; 但是大佬实现的方法中
public override bool TryGetValue(string key, out object value) { try { value = RedisHelper.Get(GetLocalizedRedisKey(key)); return true; } catch { value = null; return false; } }
默认为只要是没有异常就返回true,这里会导致项目启动获取语言列表的时候如果没有缓存,将null设置到Dictionary中而抛出异常。 将代码改为:
public override bool TryGetValue(string key, out object value) { try { var objbyte = RedisHelper.Get(GetLocalizedRedisKey(key)); value = objbyte != null ? Deserialize(objbyte) : null; return objbyte != null; } catch { value = null; return false; } }
项目能正常启动,但是我不太确定这种写法有没有其他的隐患,还请大佬指正。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在AbpRedisCache类中的重写方法TryGetValue(string key, out object value)中
按照官方AbpRedisCache类的实现逻辑,如果没有缓存key,则该方法应该将返回值设置为false,并将value设置为null;
但是大佬实现的方法中
默认为只要是没有异常就返回true,这里会导致项目启动获取语言列表的时候如果没有缓存,将null设置到Dictionary中而抛出异常。
将代码改为:
项目能正常启动,但是我不太确定这种写法有没有其他的隐患,还请大佬指正。
The text was updated successfully, but these errors were encountered: