Skip to content

Commit

Permalink
fixup! Disable caller as it's not necessary and generates slight delay.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszraczylo committed Jun 20, 2024
1 parent 16844e3 commit f7babe9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type CacheConfig struct {
Logger *libpack_logger.Logger
Client CacheClient
Redis struct {
Enable bool `json:"enable"`
URL string `json:"url"`
Password string `json:"password"`
DB int `json:"db"`
Enable bool `json:"enable"`
}
TTL int `json:"ttl"`
}
Expand Down
6 changes: 3 additions & 3 deletions cache/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
)

type RedisConfig struct {
client *redis.Client
ctx context.Context
prefix string
client *redis.Client
builderPool *sync.Pool
prefix string
}

func (c *RedisConfig) prependKeyName(key string) string {
Expand All @@ -29,8 +29,8 @@ func (c *RedisConfig) prependKeyName(key string) string {
type RedisClientConfig struct {
RedisServer string
RedisPassword string
RedisDB int
Prefix string
RedisDB int
}

func New(redisClientConfig *RedisClientConfig) *RedisConfig {
Expand Down
6 changes: 3 additions & 3 deletions logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ const (
var defaultOutput = os.Stdout

type Logger struct {
output io.Writer
format string
minLogLevel int
showCaller bool
output io.Writer
}

type LogMessage struct {
Message string
Pairs map[string]any
output io.Writer
Pairs map[string]any
Message string
}

func (m *LogMessage) String() string {
Expand Down
6 changes: 3 additions & 3 deletions logging/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ func (suite *LoggerTestSuite) Test_LogsLevelsPrint() {
logger := New().SetOutput(output)

tests := []struct {
pairs map[string]any
name string
method string
message string
loggerMinLevel int
messageLogLevel int
message string
pairs map[string]any
wantOutput bool // Whether we expect output to be written
wantOutput bool
}{
{
name: "Log: Debug, Level: Debug - no pairs",
Expand Down
2 changes: 1 addition & 1 deletion monitoring/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

// Cache for sorted label keys to avoid repeated sorting
var sortedLabelKeysCache = struct {
sync.RWMutex
m map[string][]string
sync.RWMutex
}{m: make(map[string][]string)}

func (ms *MetricsSetup) get_metrics_name(name string, labels map[string]string) string {
Expand Down
2 changes: 1 addition & 1 deletion monitoring/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ func TestEnsureDefaultLabels(t *testing.T) {
libpack_config.PKG_NAME = "example_microservice"

tests := []struct {
name string
inputLabels map[string]string
expectedLabels map[string]string
name string
}{
{
name: "Nil labels",
Expand Down

0 comments on commit f7babe9

Please sign in to comment.