minimize allocations in logger and tunnel code (#1323)
* logs alloc Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * fix allocs Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * fix allocs Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * tunnel allocs Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * try to fix tunnel Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * cache cipher for send Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * more logger Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * more logger Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * more logger Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * more logger Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * more logger Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * more logger Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * more logger Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
1205227bd3
commit
d7aec2236e
10
cache.go
10
cache.go
@ -7,7 +7,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
log "github.com/micro/go-micro/v2/logger"
|
"github.com/micro/go-micro/v2/logger"
|
||||||
"github.com/micro/go-micro/v2/registry"
|
"github.com/micro/go-micro/v2/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -339,7 +339,9 @@ func (c *cache) run() {
|
|||||||
c.setStatus(err)
|
c.setStatus(err)
|
||||||
|
|
||||||
if a > 3 {
|
if a > 3 {
|
||||||
log.Info("rcache: ", err, " backing off ", d)
|
if logger.V(logger.InfoLevel, logger.DefaultLogger) {
|
||||||
|
logger.Info("rcache: ", err, " backing off ", d)
|
||||||
|
}
|
||||||
a = 0
|
a = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +364,9 @@ func (c *cache) run() {
|
|||||||
c.setStatus(err)
|
c.setStatus(err)
|
||||||
|
|
||||||
if b > 3 {
|
if b > 3 {
|
||||||
log.Info("rcache: ", err, " backing off ", d)
|
if logger.V(logger.InfoLevel, logger.DefaultLogger) {
|
||||||
|
logger.Info("rcache: ", err, " backing off ", d)
|
||||||
|
}
|
||||||
b = 0
|
b = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user