More error handling fixes
This commit is contained in:
parent
ec9bfa5ece
commit
eaae782180
@ -12,6 +12,7 @@ import (
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/html"
|
||||
"pault.ag/go/debian/version"
|
||||
)
|
||||
|
||||
func StartPackageQueueWorker(ctx context.Context) {
|
||||
@ -34,22 +35,34 @@ func StartPackageQueueWorker(ctx context.Context) {
|
||||
if v.Status == domain.Current {
|
||||
return true
|
||||
}
|
||||
version := v.NewVersion
|
||||
if version == "" {
|
||||
version = v.Version
|
||||
vs := v.NewVersion
|
||||
if vs == "" {
|
||||
vs = v.Version
|
||||
}
|
||||
if v.Status == domain.Missing {
|
||||
needsBuild = true
|
||||
buildVersion = version
|
||||
if v.LastBuildStatus == domain.Error {
|
||||
if v.BuildAttempts > 0 {
|
||||
buildAttempt = v.BuildAttempts
|
||||
return false
|
||||
}
|
||||
if v.Status == domain.Stale {
|
||||
}
|
||||
if v.Status == domain.Missing || v.Status == domain.Stale {
|
||||
needsBuild = true
|
||||
buildVersion = version
|
||||
buildAttempt = v.BuildAttempts
|
||||
return false
|
||||
}
|
||||
if buildVersion == "" {
|
||||
buildVersion = vs
|
||||
} else {
|
||||
ver, err := version.Parse(buildVersion)
|
||||
if err != nil {
|
||||
return true
|
||||
}
|
||||
vsVer, err := version.Parse(vs)
|
||||
if err != nil {
|
||||
return true
|
||||
}
|
||||
if version.Compare(ver, vsVer) < 0 {
|
||||
buildVersion = vs
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
if needsBuild {
|
||||
|
Loading…
Reference in New Issue
Block a user