public string CreateChat(CreateChatModel model) { try { var response = _backend.CreateChat(WorkerContext, model); if (response.Success) { var chatId = response.Body; foreach (var user in model.Users) { AddToChat(user, chatId); } Logger.Debug(LogKey + model); return(chatId); } Logger.Warn(response + LogKey + model); } catch (Exception e) { Logger.Error(e); } return(null); }
public ResponseModel <string> CreateChat(IWorkerContext context, CreateChatModel model) { var response = _backend.CreateChat(context, model); if (response.Success) { foreach (var userId in model.Users) { var key = GetChatKey(userId); _cache.Remove(key); } } return(response); }
public ResponseModel <string> CreateChat(IWorkerContext context, CreateChatModel model) { var response = _backend.CreateChat(context, model); if (response.Success) { foreach (var userId in model.Users) { var key = Pref("GetChats_" + userId); _redis.GetDatabase().KeyDelete(key, CommandFlags.FireAndForget); } } return(response); }