PublishServerUpdate error
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2023-09-26 13:04:30 -07:00 committed by Gitea
parent 7a962359b3
commit c0bc3b0803
2 changed files with 5 additions and 3 deletions

View File

@ -415,10 +415,11 @@ func (app *application) ConfigureConnections(onion string, listen bool, peers bo
profile.Listen() profile.Listen()
} }
app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.ResumeRetries)) app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.ResumeRetries))
// do this in the background, for large contact lists it can take a long time... // do this in the background, for large contact lists it can take a long time...
go profile.StartConnections(peers, servers) go profile.StartConnections(peers, servers)
} else {
log.Errorf("profile does not exist %v", onion)
} }
} }

View File

@ -87,10 +87,11 @@ type Server struct {
} }
// PublishServerUpdate serializes the current list of group servers and publishes an event with this information // PublishServerUpdate serializes the current list of group servers and publishes an event with this information
func (f *Functionality) PublishServerUpdate(profile peer.CwtchPeer) { func (f *Functionality) PublishServerUpdate(profile peer.CwtchPeer) error {
serverListForOnion := f.GetServerInfoList(profile) serverListForOnion := f.GetServerInfoList(profile)
serversListBytes, _ := json.Marshal(serverListForOnion) serversListBytes, err := json.Marshal(serverListForOnion)
profile.PublishEvent(event.NewEvent(UpdateServerInfo, map[event.Field]string{"ProfileOnion": profile.GetOnion(), ServerList: string(serversListBytes)})) profile.PublishEvent(event.NewEvent(UpdateServerInfo, map[event.Field]string{"ProfileOnion": profile.GetOnion(), ServerList: string(serversListBytes)}))
return err
} }
// GetServerInfoList compiles all the information the UI might need regarding all servers.. // GetServerInfoList compiles all the information the UI might need regarding all servers..