mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2024-11-21 05:05:52 +02:00
сделал nrpc
This commit is contained in:
parent
e403cc1261
commit
969d562ed9
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user