Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions backend/modules/soar/handler/command_ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ func (h *CommandWSHandler) CommandStream(c *gin.Context) {
return
}
// A fresh context: ctx is cancelled by the time this runs on a
// disconnect, and the row still has to be closed.
done, cancelDone := context.WithTimeout(context.Background(), 5*time.Second)
// disconnect, and the row still has to be closed. The tenancy GORM
// callback needs the acting tenant in the context, so carry it over
// from the actor — a bare context.Background() fails the update with
// ErrNoTenant whenever multi-tenancy is enabled.
done, cancelDone := context.WithTimeout(authz.WithTenantID(context.Background(), actor.TenantID), 5*time.Second)
defer cancelDone()
_ = h.executionUC.FinishManual(done, execID, status, collected.String())
}
Expand Down
Loading