修复相关bug
This commit is contained in:
@@ -25,6 +25,10 @@ public class ConfigService : DbRepository<SysConfig>, IConfigService
|
||||
/// <inheritdoc/>
|
||||
public async Task<List<SysConfig>> GetConfigsByCategory(string category)
|
||||
{
|
||||
// 业务自定义配置需立即生效,始终以数据库中的最新数据为准。
|
||||
if (category == CateGoryConst.CONFIG_BIZ_DEFINE)
|
||||
return await GetListAsync(it => it.Category == category);
|
||||
|
||||
var key = SystemConst.CACHE_DEV_CONFIG + category;//系统配置key
|
||||
//先从redis拿配置
|
||||
var configList = _simpleCacheService.HashGetAll<SysConfig>(key).Values.ToList();
|
||||
@@ -51,6 +55,10 @@ public class ConfigService : DbRepository<SysConfig>, IConfigService
|
||||
/// <inheritdoc/>
|
||||
public async Task<SysConfig> GetByConfigKey(string category, string configKey)
|
||||
{
|
||||
// 业务自定义配置不走缓存,避免修改后仍读取到本机旧值。
|
||||
if (category == CateGoryConst.CONFIG_BIZ_DEFINE)
|
||||
return await GetFirstAsync(it => it.Category == category && it.ConfigKey == configKey);
|
||||
|
||||
var key = SystemConst.CACHE_DEV_CONFIG + category;//系统配置key
|
||||
//先从redis拿配置
|
||||
var config = _simpleCacheService.HashGetOne<SysConfig>(key, configKey);
|
||||
|
||||
Reference in New Issue
Block a user