1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2024-11-24 08:22:42 +02:00

сделал nrpc

This commit is contained in:
Nikitin Aleksandr 2024-11-18 12:51:33 +03:00
parent e403cc1261
commit 969d562ed9
2 changed files with 12 additions and 4 deletions

View File

@ -232,9 +232,9 @@ func SetTimeoutSeconds(seconds int) {
// Connect_GRPC_NRPC - подключается к серверу GRPC или NRPC, при ошибке вызывает панику
func (Object_Connect_GRPC_NRPC) Connect_GRPC_NRPC() {
if grpc_nrpc.NeedNRPC == true {
if nrpc_client.Client == nil {
nrpc_client.Connect()
}
//if nrpc_client.Client == nil {
// nrpc_client.Connect()
//}
} else {
if grpc_client_func.Client == nil {
Connect()

View File

@ -53,9 +53,17 @@ func CreateGRPCClient() error {
TextGRPCClient = create_files.AddImport(TextGRPCClient, GRPC_NRPC_URL)
//nrpc_client
if config.Settings.NEED_CREATE_NRPC == false {
if config.Settings.NEED_CREATE_NRPC == true {
NRPC_CLIENT_URL := create_files.Find_NRPC_Client_URL()
TextGRPCClient = create_files.AddImport(TextGRPCClient, NRPC_CLIENT_URL)
//
TextTemplate := ` //if nrpc_client.Client == nil {
// nrpc_client.Connect()
//}
`
TextNew := strings.ReplaceAll(TextTemplate, "//", "")
TextGRPCClient = strings.ReplaceAll(TextGRPCClient, TextTemplate, TextNew)
}
//grpc_client_func