fix panic

This commit is contained in:
DeniskaRediska committed 2019-10-23 15:41:58 +03:00
1 parent 3461f20510
commit f3934e038e
4 files changed
+15 -1

No files matched your search

+1 -1
View File
@@ -1 +1 @@
0.0.3
0.0.4
+5
View File
@@ -31,6 +31,11 @@ func NewProxy() *grpcProxy {
}
func (p *grpcProxy) ProxyRequest(ctx *fasthttp.RequestCtx) {
if p.client == nil {
log.Error(log_code.ErrorClientGrpc, "client undefined")
return
}
currentTime := time.Now()
uri := string(ctx.RequestURI())
+5
View File
@@ -30,6 +30,11 @@ func (p *httpProxy) Consumer(addressList []structure.AddressConfiguration) bool
}
func (p *httpProxy) ProxyRequest(ctx *fasthttp.RequestCtx) {
if p.client == nil {
log.Error(log_code.ErrorClientHttp, "client undefined")
return
}
req := &ctx.Request
res := &ctx.Response
+4
View File
@@ -21,6 +21,10 @@ func (c *redisClient) ReceiveConfiguration(configuration structure.RedisConfigur
}
func (c *redisClient) GetTokens(appToken string) (map[string]string, error) {
if c.cli == nil {
return nil, errors.New("client undefined")
}
instanceUuid := config.Get().(*conf.Configuration).InstanceUuid
key := fmt.Sprintf("%s|%s", appToken, instanceUuid)