mirror of
https://github.com/Kyren223/eko.git
synced 2026-07-11 14:59:29 +00:00
Updated build date in metrics to be of iso format (yyyy-mm-dd)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user