mirror of
https://github.com/Luzifer/go-latestver.git
synced 2024-11-12 17:02:41 +00:00
Store only second timestamps, use UTC
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
02ec355192
commit
128eb0f8ba
1 changed files with 2 additions and 1 deletions
|
@ -54,6 +54,7 @@ func checkForUpdates(ce *database.CatalogEntry) error {
|
||||||
|
|
||||||
ver, vertime, err := fetcher.Get(ce.Fetcher).FetchVersion(context.Background(), &ce.FetcherConfig)
|
ver, vertime, err := fetcher.Get(ce.Fetcher).FetchVersion(context.Background(), &ce.FetcherConfig)
|
||||||
ver = strings.TrimPrefix(ver, "v")
|
ver = strings.TrimPrefix(ver, "v")
|
||||||
|
vertime = vertime.Truncate(time.Second).UTC()
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
|
||||||
|
@ -87,7 +88,7 @@ func checkForUpdates(ce *database.CatalogEntry) error {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cm.LastChecked = ptrTime(time.Now())
|
cm.LastChecked = ptrTime(time.Now().Truncate(time.Second).UTC())
|
||||||
return errors.Wrap(storage.Catalog.PutMeta(cm), "updating meta entry")
|
return errors.Wrap(storage.Catalog.PutMeta(cm), "updating meta entry")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue