From ef0dcf6bee910fc9e9e3079a1fcecd4ed1437604 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 25 Aug 2022 14:38:19 +0100 Subject: [PATCH] Use background context, don't fall through --- clientapi/routing/admin.go | 3 ++- roomserver/internal/perform/perform_admin.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/clientapi/routing/admin.go b/clientapi/routing/admin.go index 2893dbf88..622b8e1d1 100644 --- a/clientapi/routing/admin.go +++ b/clientapi/routing/admin.go @@ -1,6 +1,7 @@ package routing import ( + "context" "encoding/json" "net/http" @@ -104,7 +105,7 @@ func AdminPurgeRoom(req *http.Request, cfg *config.ClientAPI, device *userapi.De } res := &roomserverAPI.PerformAdminPurgeRoomResponse{} if err := rsAPI.PerformAdminPurgeRoom( - req.Context(), + context.Background(), &roomserverAPI.PerformAdminPurgeRoomRequest{ RoomID: roomID, }, diff --git a/roomserver/internal/perform/perform_admin.go b/roomserver/internal/perform/perform_admin.go index bf2157aaf..0f55b4c89 100644 --- a/roomserver/internal/perform/perform_admin.go +++ b/roomserver/internal/perform/perform_admin.go @@ -253,6 +253,7 @@ func (r *Admin) PerformAdminPurgeRoom( Code: api.PerformErrorBadRequest, Msg: err.Error(), } + return nil } else { logrus.WithField("room_id", req.RoomID).Warn("Room purged from roomserver") }