fix:删除缓存中的发件邮箱信息
This commit is contained in:
parent
cf81fab98a
commit
6666e74a98
|
@ -270,12 +270,16 @@ public class SysEmailServiceImpl extends ServiceImpl<SysEmailMapper, SysEmail> i
|
||||||
wrapper.eq(SysEmail::getEnabled, ENABLED.getValue());
|
wrapper.eq(SysEmail::getEnabled, ENABLED.getValue());
|
||||||
List<SysEmail> emails = this.list(wrapper);
|
List<SysEmail> emails = this.list(wrapper);
|
||||||
Optional<SysEmail> first = emails.stream().findFirst();
|
Optional<SysEmail> first = emails.stream().findFirst();
|
||||||
if(!first.isPresent()) return null;
|
if(first.isPresent()) {
|
||||||
SysEmail sender = first.get();
|
SysEmail sender = first.get();
|
||||||
redisUtil.set(RedisConstant.EMAIL_SENDER, sender);
|
redisUtil.set(RedisConstant.EMAIL_SENDER, sender);
|
||||||
log.info("缓存了可用的发件邮箱到Redis: {}", sender.getUsername());
|
|
||||||
return sender;
|
return sender;
|
||||||
}
|
}
|
||||||
|
// 删除缓存中旧的发件邮箱信息
|
||||||
|
if (redisUtil.hasKey(RedisConstant.EMAIL_SENDER))
|
||||||
|
redisUtil.del(RedisConstant.EMAIL_SENDER);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 删除指定id的邮箱服务器的状态值
|
* 删除指定id的邮箱服务器的状态值
|
||||||
|
|
Loading…
Reference in New Issue
Block a user