mirror of
https://github.com/safing/portmaster
synced 2025-04-23 04:19:10 +00:00
[updates] fix: Initial update failed due to the published date of the actual index being in the past
This commit is contained in:
parent
776b4860ef
commit
149e1609bb
1 changed files with 10 additions and 3 deletions
|
@ -205,9 +205,16 @@ func New(instance instance, name string, cfg Config) (*Updater, error) {
|
|||
Name: configure.DefaultBinaryIndexName,
|
||||
Version: info.VersionNumber(),
|
||||
})
|
||||
if err == nil && index.init(currentPlatform) == nil {
|
||||
module.index = index
|
||||
return module, nil
|
||||
if err == nil {
|
||||
// As the index is generated from the current directory,
|
||||
// we must set the published date to a fixed point in the past.
|
||||
// New indexes will only be considered if their published date is later than the current one.
|
||||
index.Published = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
|
||||
if index.init(currentPlatform) == nil {
|
||||
module.index = index
|
||||
return module, nil
|
||||
}
|
||||
}
|
||||
|
||||
// Fall back to empty index.
|
||||
|
|
Loading…
Add table
Reference in a new issue