更新用户信息时,先写入数据库再存入缓存中,防止异步操作写入数据库失败造成数据不一致

This commit is contained in:
heavyrain.lee
2020-01-10 10:25:34 +08:00
parent bace7ec70c
commit 9eb5fdd805
7 changed files with 39 additions and 10 deletions
@@ -18,6 +18,11 @@ import win.liyufan.im.IMTopic;
public class ModifyMyInfoHandler extends IMHandler<WFCMessage.ModifyMyInfoRequest> {
@Override
public ErrorCode action(ByteBuf ackPayload, String clientID, String fromUser, boolean isAdmin, WFCMessage.ModifyMyInfoRequest request, Qos1PublishHandler.IMCallback callback) {
try {
return m_messagesStore.modifyUserInfo(fromUser, request);
} catch (Exception e) {
e.printStackTrace();
return ErrorCode.ERROR_CODE_SERVER_ERROR;
}
}
}