Fix always missing

This commit is contained in:
ferreo 2024-08-04 11:20:13 +01:00
parent c0a79f2692
commit bfd6f2e2a9

View File

@ -39,8 +39,8 @@ func ProcessPackages() error {
combinePackages(internalPackages)
combinePackages(externalPackages)
ProcessStalePackages(internalPackages, externalPackages)
ProcessMissingPackages(internalPackages, externalPackages)
ProcessStalePackages(internalPackages, externalPackages)
updatedPackages := haxmap.New[string, domain.SourcePackage]()
@ -350,36 +350,6 @@ func ProcessStalePackages(internalPackages *haxmap.Map[string, domain.SourcePack
})
return true
})
wasMissing := false
newSource.Packages.ForEach(func(newKey string, newPackage domain.PackageInfo) bool {
found := false
matchedPackage.Packages.ForEach(func(currentKey string, currentPackage domain.PackageInfo) bool {
if currentKey != newKey {
return true
}
found = true
return false
})
if !found {
wasMissing = true
newPackage.Status = domain.Missing
newPackage.NewVersion = newPackage.Version
matchedPackage.Packages.Set(newKey, newPackage)
}
return true
})
if wasMissing {
matchedPackage.Packages.ForEach(func(k string, v domain.PackageInfo) bool {
if v.Status == domain.Error {
return true
}
if v.Status == domain.Missing {
return true
}
v.Status = domain.Missing
return true
})
}
return true
})
}