GODT-1843: Wait for the currently running application on restart even while updating

This commit is contained in:
Romain LE JEUNE
2022-09-05 19:47:06 +02:00
parent 4e47e7ac2a
commit 5ae50047e0
16 changed files with 951 additions and 634 deletions

View File

@ -8,7 +8,6 @@ package grpc
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -50,6 +49,7 @@ type BridgeClient interface {
CurrentEmailClient(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
ReportBug(ctx context.Context, in *ReportBugRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
ForceLauncher(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
SetMainExecutable(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
// login
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
Login2FA(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
@ -314,6 +314,15 @@ func (c *bridgeClient) ForceLauncher(ctx context.Context, in *wrapperspb.StringV
return out, nil
}
func (c *bridgeClient) SetMainExecutable(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/grpc.Bridge/SetMainExecutable", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bridgeClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/grpc.Bridge/Login", in, out, opts...)
@ -645,6 +654,7 @@ type BridgeServer interface {
CurrentEmailClient(context.Context, *emptypb.Empty) (*wrapperspb.StringValue, error)
ReportBug(context.Context, *ReportBugRequest) (*emptypb.Empty, error)
ForceLauncher(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
SetMainExecutable(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
// login
Login(context.Context, *LoginRequest) (*emptypb.Empty, error)
Login2FA(context.Context, *LoginRequest) (*emptypb.Empty, error)
@ -762,6 +772,9 @@ func (UnimplementedBridgeServer) ReportBug(context.Context, *ReportBugRequest) (
func (UnimplementedBridgeServer) ForceLauncher(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ForceLauncher not implemented")
}
func (UnimplementedBridgeServer) SetMainExecutable(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetMainExecutable not implemented")
}
func (UnimplementedBridgeServer) Login(context.Context, *LoginRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
}
@ -1300,6 +1313,24 @@ func _Bridge_ForceLauncher_Handler(srv interface{}, ctx context.Context, dec fun
return interceptor(ctx, in, info, handler)
}
func _Bridge_SetMainExecutable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(wrapperspb.StringValue)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BridgeServer).SetMainExecutable(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.Bridge/SetMainExecutable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BridgeServer).SetMainExecutable(ctx, req.(*wrapperspb.StringValue))
}
return interceptor(ctx, in, info, handler)
}
func _Bridge_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LoginRequest)
if err := dec(in); err != nil {
@ -1964,6 +1995,10 @@ var Bridge_ServiceDesc = grpc.ServiceDesc{
MethodName: "ForceLauncher",
Handler: _Bridge_ForceLauncher_Handler,
},
{
MethodName: "SetMainExecutable",
Handler: _Bridge_SetMainExecutable_Handler,
},
{
MethodName: "Login",
Handler: _Bridge_Login_Handler,