summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store.go
diff options
context:
space:
mode:
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r--store/sql_user_store.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index 9d981b13e..d18da8df8 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -814,7 +814,8 @@ func (us SqlUserStore) GetProfileByIds(userIds []string, allowFromCache bool) St
if allowFromCache {
for _, userId := range userIds {
if cacheItem, ok := profileByIdsCache.Get(userId); ok {
- u := cacheItem.(*model.User)
+ u := &model.User{}
+ *u = *cacheItem.(*model.User)
users = append(users, u)
} else {
remainingUserIds = append(remainingUserIds, userId)
@@ -855,7 +856,9 @@ func (us SqlUserStore) GetProfileByIds(userIds []string, allowFromCache bool) St
for _, u := range users {
u.Sanitize(map[string]bool{})
- profileByIdsCache.AddWithExpiresInSecs(u.Id, u, PROFILE_BY_IDS_CACHE_SEC)
+ cpy := &model.User{}
+ *cpy = *u
+ profileByIdsCache.AddWithExpiresInSecs(cpy.Id, cpy, PROFILE_BY_IDS_CACHE_SEC)
}
result.Data = users