add Metric
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user