mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
feat: add download count field and unit testing for attachment. (#1512)
* feat: add download count field and unit testing. * fix: unit testing * refactor: improve testing. * fix: update comment * add default value. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -351,6 +351,11 @@ func runWeb(ctx *cli.Context) error {
|
||||
}
|
||||
defer fr.Close()
|
||||
|
||||
if err := attach.IncreaseDownloadCount(); err != nil {
|
||||
ctx.Handle(500, "Update", err)
|
||||
return
|
||||
}
|
||||
|
||||
if err = repo.ServeData(ctx, attach.Name, fr); err != nil {
|
||||
ctx.Handle(500, "ServeData", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user