From e10a1309c14d39c58638adc31eb46d8bbb497053 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Wed, 7 May 2025 09:04:22 +0200 Subject: [PATCH] [MM-61774] Fix errcheck issues in server/channels/app/platform/status.go (#30876) Co-authored-by: Claude --- server/.golangci.yml | 1 - server/channels/app/platform/status.go | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/.golangci.yml b/server/.golangci.yml index 3267f612f8..e51cd3402e 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -96,7 +96,6 @@ issues: channels/app/permissions_test.go|\ channels/app/platform/helper_test.go|\ channels/app/platform/license.go|\ - channels/app/platform/status.go|\ channels/app/slashcommands/command_test.go|\ channels/app/slashcommands/helper_test.go|\ channels/app/upload.go|\ diff --git a/server/channels/app/platform/status.go b/server/channels/app/platform/status.go index d8bf6609e3..8047240964 100644 --- a/server/channels/app/platform/status.go +++ b/server/channels/app/platform/status.go @@ -16,7 +16,9 @@ import ( ) func (ps *PlatformService) AddStatusCacheSkipClusterSend(status *model.Status) { - ps.statusCache.SetWithDefaultExpiry(status.UserId, status) + if err := ps.statusCache.SetWithDefaultExpiry(status.UserId, status); err != nil { + ps.logger.Warn("Failed to set cache entry for status", mlog.String("user_id", status.UserId), mlog.Err(err)) + } } func (ps *PlatformService) AddStatusCache(status *model.Status) { @@ -287,7 +289,9 @@ func (ps *PlatformService) UpdateLastActivityAtIfNeeded(session model.Session) { } session.LastActivityAt = now - ps.AddSessionToCache(&session) + if err := ps.AddSessionToCache(&session); err != nil { + mlog.Warn("Failed to add session to cache", mlog.String("user_id", session.UserId), mlog.String("session_id", session.Id), mlog.Err(err)) + } } func (ps *PlatformService) SetStatusOnline(userID string, manual bool) {