From cd7e04ec0d33029e08ed257de41fba96c4f9283d Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Mon, 22 May 2017 21:06:14 +0200 Subject: [PATCH] mediaapi/writers/download: Move comment next to code to which it refers --- .../matrix-org/dendrite/mediaapi/writers/download.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go b/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go index bc6fb6d98..b49255562 100644 --- a/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go +++ b/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go @@ -118,12 +118,12 @@ func Download(w http.ResponseWriter, req *http.Request, origin gomatrixserverlib return } else if err == sql.ErrNoRows && r.MediaMetadata.Origin != cfg.ServerName { // If we do not have a record and the origin is remote, we need to fetch it and respond with that file - // The following code using activeRemoteRequests is avoiding duplication of fetches from the remote server in the case - // of multiple simultaneous incoming requests for the same remote file - it will be downloaded once, cached and served - // to all clients. mxcURL := "mxc://" + string(r.MediaMetadata.Origin) + "/" + string(r.MediaMetadata.MediaID) + // The following code using activeRemoteRequests is avoiding duplication of fetches from the remote server in the case + // of multiple simultaneous incoming requests for the same remote file - it will be downloaded once, cached and served + // to all clients. activeRemoteRequests.Lock() mediaMetadata, err = db.GetMediaMetadata(r.MediaMetadata.MediaID, r.MediaMetadata.Origin) if err == nil {