mirror of
https://github.com/Jguer/yay.git
synced 2024-11-07 09:37:22 +01:00
fix(devel): timeout devel check after 5 secs (#1929)
timeout devel check after 5 secs
This commit is contained in:
parent
4780a974d9
commit
3ef4664d99
@ -2,6 +2,7 @@ package upgrade
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
|
|
||||||
@ -20,8 +21,10 @@ func UpDevel(
|
|||||||
toRemove := make([]string, 0)
|
toRemove := make([]string, 0)
|
||||||
toUpgrade := UpSlice{Up: make([]Upgrade, 0), Repos: []string{"devel"}}
|
toUpgrade := UpSlice{Up: make([]Upgrade, 0), Repos: []string{"devel"}}
|
||||||
|
|
||||||
|
ctxTimeout, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||||
|
defer cancel()
|
||||||
for pkgName, pkg := range remote {
|
for pkgName, pkg := range remote {
|
||||||
if localCache.ToUpgrade(ctx, pkgName) {
|
if localCache.ToUpgrade(ctxTimeout, pkgName) {
|
||||||
if _, ok := aurdata[pkgName]; !ok {
|
if _, ok := aurdata[pkgName]; !ok {
|
||||||
text.Warnln(gotext.Get("ignoring package devel upgrade (no AUR info found):"), pkgName)
|
text.Warnln(gotext.Get("ignoring package devel upgrade (no AUR info found):"), pkgName)
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user