mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 15:51:14 +00:00
feat: prometheus
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"nysoure/server/middleware"
|
||||
"nysoure/server/model"
|
||||
"nysoure/server/service"
|
||||
"nysoure/server/stat"
|
||||
"nysoure/server/utils"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -240,6 +241,7 @@ func downloadFile(c fiber.Ctx) error {
|
||||
}
|
||||
q.Set("token", token)
|
||||
uri.RawQuery = q.Encode()
|
||||
stat.RecordDownload()
|
||||
return c.Redirect().Status(fiber.StatusFound).To(uri.String())
|
||||
}
|
||||
data := map[string]string{
|
||||
@@ -251,6 +253,7 @@ func downloadFile(c fiber.Ctx) error {
|
||||
if err != nil {
|
||||
return model.NewInternalServerError("Failed to generate download token")
|
||||
}
|
||||
stat.RecordDownload()
|
||||
return c.Redirect().Status(fiber.StatusFound).To(fmt.Sprintf("%s/api/files/download/local?token=%s", c.BaseURL(), token))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user