summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyren223 <kyren223@proton.me>2025-08-04 01:30:47 +0300
committerKyren223 <kyren223@proton.me>2025-08-04 01:30:47 +0300
commit22fe5231e2503dc6ccdbbf01d4ee58702380f7a4 (patch)
tree266d0deb933185f15d6b496ada43d1305a6bb00e
parent57f7c9acc200a10537d478d16e4d636bdaa8c71e (diff)
Updated build date in metrics to be of iso format (yyyy-mm-dd)
-rw-r--r--cmd/server/main.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 2df68c4..d5ecae9 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -51,16 +51,16 @@ const (
var prod = true
func main() {
+ buildDate := embeds.BuildDate
+ if buildDate != "unknown" {
+ t, err := strconv.ParseInt(buildDate, 10, 64)
+ if err == nil {
+ buildDate = time.Unix(t, 0).Format("2006-01-02")
+ }
+ }
if len(os.Args) > 1 && os.Args[1] == "-v" {
fmt.Println("version:", embeds.Version)
fmt.Println("commit:", embeds.Commit)
- buildDate := embeds.BuildDate
- if buildDate != "unknown" {
- t, err := strconv.ParseInt(buildDate, 10, 64)
- if err == nil {
- buildDate = time.Unix(t, 0).Format("2006-01-02")
- }
- }
fmt.Println("build date:", buildDate)
return
}
@@ -84,7 +84,7 @@ func main() {
metrics.BuildInfo.With(prometheus.Labels{
"version": embeds.Version,
"commit": embeds.Commit,
- "build_date": embeds.BuildDate,
+ "build_date": buildDate,
}).Set(1)
if ok := reloadTosAndPrivacy(); !ok {