add Metric
All checks were successful
Build Docker Image / build (arm64) (push) Successful in 54s
Build Docker Image / build (amd64) (push) Successful in 2m13s
Build Docker Image / amend-manifest (push) Successful in 5s

This commit is contained in:
thuanle
2024-11-07 09:08:19 +07:00
parent b0ac68cbdb
commit 108458682e
5 changed files with 91 additions and 1 deletions

View File

@@ -5,8 +5,11 @@ import (
"github.com/rs/zerolog/log"
"thuanle.me/ip-info/configs"
"thuanle.me/ip-info/internal/data"
"time"
)
var DbUpdatedAt time.Time
func StartUpdateDbService() {
c := cron.New()
_, _ = c.AddFunc("@daily", fetchDbs)
@@ -29,5 +32,7 @@ func fetchDbs() {
log.Err(err).Msg("Failed to reload mmdb")
return
}
DbUpdatedAt = time.Now()
}
}