mirror of
https://github.com/safing/portmaster
synced 2025-09-02 10:39:22 +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...")
|
log.Println("error seems to be permanent, giving up...")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// resilience
|
||||||
|
time.Sleep(time.Duration(tries) * 2 * time.Second)
|
||||||
|
if tries >= 2 {
|
||||||
|
// try updating
|
||||||
|
updateRegistryIndex()
|
||||||
|
}
|
||||||
log.Println("trying again...")
|
log.Println("trying again...")
|
||||||
case tryAgain && err == nil:
|
case tryAgain && err == nil:
|
||||||
|
// reset error count
|
||||||
|
tries = 0
|
||||||
// upgrade
|
// upgrade
|
||||||
log.Println("restarting by request...")
|
log.Println("restarting by request...")
|
||||||
// update index
|
// update index
|
||||||
|
|
Loading…
Add table
Reference in a new issue