summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-02-27 17:43:23 -0500
committerChristopher Speller <crspeller@gmail.com>2017-02-27 17:43:23 -0500
commit83c113595ace467ad34f05e35fb2282fa8631a17 (patch)
treecb69e0bf9d2a04e0d622e5151181c65527bc90bc /app
parent55752fb359f805196e9acc1497cee658d30fa6ed (diff)
downloadchat-83c113595ace467ad34f05e35fb2282fa8631a17.tar.gz
chat-83c113595ace467ad34f05e35fb2282fa8631a17.tar.bz2
chat-83c113595ace467ad34f05e35fb2282fa8631a17.zip
Revert "Adding caching to get channel member (#5518)"
This reverts commit ba028ed74b69bd1dd902344663fbf8ba4f1dfb87.
Diffstat (limited to 'app')
-rw-r--r--app/channel.go11
-rw-r--r--app/team.go1
-rw-r--r--app/web_hub.go12
3 files changed, 4 insertions, 20 deletions
diff --git a/app/channel.go b/app/channel.go
index 8352b3b9d..533a2f0bb 100644
--- a/app/channel.go
+++ b/app/channel.go
@@ -180,7 +180,7 @@ func WaitForChannelMembership(channelId string, userId string) {
time.Sleep(100 * time.Millisecond)
- result := <-Srv.Store.Channel().GetMember(channelId, userId, true)
+ result := <-Srv.Store.Channel().GetMember(channelId, userId)
// If the membership was found then return
if result.Err == nil {
@@ -219,7 +219,6 @@ func UpdateChannelMemberRoles(channelId string, userId string, newRoles string)
return nil, result.Err
}
- InvalidateCacheForChannelMember(channelId, userId)
InvalidateCacheForUser(userId)
return member, nil
}
@@ -251,7 +250,6 @@ func UpdateChannelMemberNotifyProps(data map[string]string, channelId string, us
if result := <-Srv.Store.Channel().UpdateMember(member); result.Err != nil {
return nil, result.Err
} else {
- InvalidateCacheForChannelMember(channelId, userId)
InvalidateCacheForUser(userId)
InvalidateCacheForChannelMembersNotifyProps(channelId)
return member, nil
@@ -340,7 +338,7 @@ func addUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelM
}
tmchan := Srv.Store.Team().GetMember(channel.TeamId, user.Id)
- cmchan := Srv.Store.Channel().GetMember(channel.Id, user.Id, true)
+ cmchan := Srv.Store.Channel().GetMember(channel.Id, user.Id)
if result := <-tmchan; result.Err != nil {
return nil, result.Err
@@ -595,7 +593,7 @@ func GetChannelsUserNotIn(teamId string, userId string, offset int, limit int) (
}
func GetChannelMember(channelId string, userId string) (*model.ChannelMember, *model.AppError) {
- if result := <-Srv.Store.Channel().GetMember(channelId, userId, true); result.Err != nil {
+ if result := <-Srv.Store.Channel().GetMember(channelId, userId); result.Err != nil {
return nil, result.Err
} else {
return result.Data.(*model.ChannelMember), nil
@@ -644,7 +642,7 @@ func GetChannelCounts(teamId string, userId string) (*model.ChannelCounts, *mode
func JoinChannel(channel *model.Channel, userId string) *model.AppError {
userChan := Srv.Store.User().Get(userId)
- memberChan := Srv.Store.Channel().GetMember(channel.Id, userId, true)
+ memberChan := Srv.Store.Channel().GetMember(channel.Id, userId)
if uresult := <-userChan; uresult.Err != nil {
return uresult.Err
@@ -797,7 +795,6 @@ func removeUserFromChannel(userIdToRemove string, removerUserId string, channel
}
InvalidateCacheForUser(userIdToRemove)
- InvalidateCacheForChannelMember(channel.Id, userIdToRemove)
InvalidateCacheForChannelMembers(channel.Id)
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_USER_REMOVED, "", channel.Id, "", nil)
diff --git a/app/team.go b/app/team.go
index ce5e107ba..0c0a6a4da 100644
--- a/app/team.go
+++ b/app/team.go
@@ -424,7 +424,6 @@ func LeaveTeam(team *model.Team, user *model.User) *model.AppError {
for _, channel := range *channelList {
if channel.Type != model.CHANNEL_DIRECT {
InvalidateCacheForChannelMembers(channel.Id)
- InvalidateCacheForChannelMember(channel.Id, user.Id)
if result := <-Srv.Store.Channel().RemoveMember(channel.Id, user.Id); result.Err != nil {
return result.Err
}
diff --git a/app/web_hub.go b/app/web_hub.go
index 90dfacbdf..a50680806 100644
--- a/app/web_hub.go
+++ b/app/web_hub.go
@@ -173,18 +173,6 @@ func InvalidateCacheForUser(userId string) {
}
}
-func InvalidateCacheForChannelMember(channelId string, userId string) {
- InvalidateCacheForChannelMemberSkipClusterSend(channelId, userId)
-
- if einterfaces.GetClusterInterface() != nil {
- einterfaces.GetClusterInterface().InvalidateCacheForChannelMember(channelId, userId)
- }
-}
-
-func InvalidateCacheForChannelMemberSkipClusterSend(channelId string, userId string) {
- Srv.Store.Channel().InvalidateMember(channelId, userId)
-}
-
func InvalidateCacheForUserSkipClusterSend(userId string) {
Srv.Store.Channel().InvalidateAllChannelMembersForUser(userId)
Srv.Store.User().InvalidateProfilesInChannelCacheByUser(userId)