GODT-1837: Fix restart.

GOTD-1837: added wait flag.
GODT-1837: strip --wait flag from launcher command-line.
GODT-1837: hide main window before restart.
This commit is contained in:
Xavier Michelon
2022-08-30 11:56:13 +02:00
parent 2780dc6a67
commit 8bb2a399cc
15 changed files with 237 additions and 67 deletions

View File

@ -20,6 +20,7 @@ package grpc
//go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative bridge.proto
import (
"context"
cryptotls "crypto/tls"
"net"
"strings"
@ -39,6 +40,7 @@ import (
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/protobuf/types/known/emptypb"
)
// Service is the RPC service struct.
@ -223,7 +225,7 @@ func (s *Service) watchEvents() { // nolint:funlen
case <-secondInstanceCh:
_ = s.SendEvent(NewShowMainWindowEvent())
case <-restartBridgeCh:
s.restart()
_, _ = s.Restart(context.Background(), &emptypb.Empty{})
case address := <-addressChangedCh:
_ = s.SendEvent(NewMailAddressChangeEvent(address))
case address := <-addressChangedLogoutCh:
@ -311,10 +313,6 @@ func (s *Service) waitForUserChangeDone(done <-chan string, userID string) {
}
}
func (s *Service) restart() {
s.restarter.SetToRestart()
}
func (s *Service) triggerReset() {
defer func() {
_ = s.SendEvent(NewResetFinishedEvent())