mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
Improve resilience when handling execution errors in pmctl
This commit is contained in:
parent
bb2cbdb5c1
commit
7926962567
1 changed files with 8 additions and 0 deletions
|
@ -185,8 +185,16 @@ func run(cmd *cobra.Command, opts *Options) (err error) {
|
|||
log.Println("error seems to be permanent, giving up...")
|
||||
return err
|
||||
}
|
||||
// resilience
|
||||
time.Sleep(time.Duration(tries) * 2 * time.Second)
|
||||
if tries >= 2 {
|
||||
// try updating
|
||||
updateRegistryIndex()
|
||||
}
|
||||
log.Println("trying again...")
|
||||
case tryAgain && err == nil:
|
||||
// reset error count
|
||||
tries = 0
|
||||
// upgrade
|
||||
log.Println("restarting by request...")
|
||||
// update index
|
||||
|
|
Loading…
Add table
Reference in a new issue