config: add RPC command to reload config

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2022-09-24 10:57:38 +02:00
parent d77bf9d479
commit f665c82b43
7 changed files with 126 additions and 1 deletions

View File

@@ -227,3 +227,11 @@ func (s *DaemonServer) GetConfig(ctx context.Context, p *rpcproto.GetConfigParam
Settings: settings,
}, nil
}
func (s *DaemonServer) ReloadConfig(ctx context.Context, params *proto.Empty) (*proto.Empty, error) {
if err := s.Config.Reload(); err != nil {
return nil, status.Errorf(codes.InvalidArgument, "failed to reload configuration: %s", err)
}
return &proto.Empty{}, nil
}