fix(devel): timeout devel check after 5 secs (#1929)

timeout devel check after 5 secs
This commit is contained in:
Jo 2023-02-21 03:48:56 +01:00 committed by GitHub
parent 4780a974d9
commit 3ef4664d99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@ package upgrade
import (
"context"
"time"
"github.com/leonelquinteros/gotext"
@ -20,8 +21,10 @@ func UpDevel(
toRemove := make([]string, 0)
toUpgrade := UpSlice{Up: make([]Upgrade, 0), Repos: []string{"devel"}}
ctxTimeout, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
for pkgName, pkg := range remote {
if localCache.ToUpgrade(ctx, pkgName) {
if localCache.ToUpgrade(ctxTimeout, pkgName) {
if _, ok := aurdata[pkgName]; !ok {
text.Warnln(gotext.Get("ignoring package devel upgrade (no AUR info found):"), pkgName)
continue