mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-28 17:54:09 -04:00
pubapi: extract StartVPNAPIServer and StartUpdateLoop as separate functions
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
77b0237dd5
commit
f2b3fc328b
4 changed files with 25 additions and 18 deletions
|
@ -95,16 +95,9 @@ func (a *API) ActivateAsCoordinator(in *pubproto.ActivateAsCoordinatorRequest, s
|
|||
}
|
||||
|
||||
// run the VPN-API server
|
||||
if err := a.vpnAPIServer.Listen(net.JoinHostPort(coordPeer.VPNIP, vpnAPIPort)); err != nil {
|
||||
if err := a.StartVPNAPIServer(coordPeer.VPNIP); err != nil {
|
||||
return status.Errorf(codes.Internal, "start vpnAPIServer: %v", err)
|
||||
}
|
||||
a.wgClose.Add(1)
|
||||
go func() {
|
||||
defer a.wgClose.Done()
|
||||
if err := a.vpnAPIServer.Serve(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
if err := a.core.SwitchToPersistentStore(); err != nil {
|
||||
return status.Errorf(codes.Internal, "switch to persistent store: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue