aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2017-04-20 10:31:31 +0800
committerGitHub <noreply@github.com>2017-04-20 10:31:31 +0800
commitfa2a513c62910c133316472247121c5c562eaf60 (patch)
treedbcb79b8bf9f0ac89ac522f871a773b5addac4b8 /cmd
parenta2d365c81fc4eb35ac598bcef696eb1b775b8a9b (diff)
downloadgitea-fa2a513c62910c133316472247121c5c562eaf60.tar.gz
gitea-fa2a513c62910c133316472247121c5c562eaf60.zip
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>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/web.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/web.go b/cmd/web.go
index a4d798d16e..6b7ec321d9 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -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