Use background context, don't fall through

This commit is contained in:
Neil Alexander 2022-08-25 14:38:19 +01:00
parent 1622df2499
commit ef0dcf6bee
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 3 additions and 1 deletions

View file

@ -1,6 +1,7 @@
package routing package routing
import ( import (
"context"
"encoding/json" "encoding/json"
"net/http" "net/http"
@ -104,7 +105,7 @@ func AdminPurgeRoom(req *http.Request, cfg *config.ClientAPI, device *userapi.De
} }
res := &roomserverAPI.PerformAdminPurgeRoomResponse{} res := &roomserverAPI.PerformAdminPurgeRoomResponse{}
if err := rsAPI.PerformAdminPurgeRoom( if err := rsAPI.PerformAdminPurgeRoom(
req.Context(), context.Background(),
&roomserverAPI.PerformAdminPurgeRoomRequest{ &roomserverAPI.PerformAdminPurgeRoomRequest{
RoomID: roomID, RoomID: roomID,
}, },

View file

@ -253,6 +253,7 @@ func (r *Admin) PerformAdminPurgeRoom(
Code: api.PerformErrorBadRequest, Code: api.PerformErrorBadRequest,
Msg: err.Error(), Msg: err.Error(),
} }
return nil
} else { } else {
logrus.WithField("room_id", req.RoomID).Warn("Room purged from roomserver") logrus.WithField("room_id", req.RoomID).Warn("Room purged from roomserver")
} }