Activate Peers After Purging Retries
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2023-09-19 15:37:26 -07:00 committed by Gitea
parent 44856003d6
commit 6d9e892408
1 changed files with 7 additions and 4 deletions

View File

@ -402,6 +402,12 @@ func (app *application) ActivatePeerEngine(onion string) {
func (app *application) ConfigureConnections(onion string, listen bool, peers bool, servers bool) {
profile := app.GetPeer(onion)
if profile != nil {
// if we are making a decision to ignore
if !peers || !servers {
app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.PurgeRetries))
}
// enable the engine if it doesn't exist...
// note: this function is idempotent
app.ActivatePeerEngine(onion)
@ -409,10 +415,7 @@ func (app *application) ConfigureConnections(onion string, listen bool, peers bo
profile.Listen()
}
// if we are making a decision to ignore
if !peers || !servers {
app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.PurgeRetries))
}
app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.ResumeRetries))
profile.StartConnections(peers, servers)
}