mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Short URL: Update last seen at when visiting a short URL (#28565)
Ref #28248 Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
aa9134b3b4
commit
60d40fa99b
@@ -57,6 +57,11 @@ func (hs *HTTPServer) redirectFromShortURL(c *models.ReqContext) {
|
||||
return
|
||||
}
|
||||
|
||||
// Failure to update LastSeenAt should still allow to redirect
|
||||
if err := hs.ShortURLService.UpdateLastSeenAt(c.Req.Context(), shortURL); err != nil {
|
||||
hs.log.Error("Failed to update short URL last seen at", "error", err)
|
||||
}
|
||||
|
||||
hs.log.Debug("Redirecting short URL", "path", shortURL.Path)
|
||||
c.Redirect(setting.ToAbsUrl(shortURL.Path), 302)
|
||||
}
|
||||
|
Reference in New Issue
Block a user