Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mativm02 committed Jan 9, 2024
1 parent 97601c9 commit 524fb01
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ func StartPurgeLoop(wg *sync.WaitGroup, ctx context.Context, secInterval int, ch
log.WithFields(logrus.Fields{
"prefix": mainPrefix,
}).Error("Error trying to execute GetAndDeleteSet: " + err.Error())
return
}
if len(AnalyticsValues) > 0 {
PreprocessAnalyticsValues(AnalyticsValues, serializerMethod, analyticsKeyName, omitDetails, job, startTime, secInterval)
Expand All @@ -236,11 +237,10 @@ func StartPurgeLoop(wg *sync.WaitGroup, ctx context.Context, secInterval int, ch
if !SystemConfig.DontPurgeUptimeData {
UptimeValues, err := UptimeStorage.GetAndDeleteSet(storage.UptimeAnalytics_KEYNAME, chunkSize, expire)
if err != nil {
if err != nil {
log.WithFields(logrus.Fields{
"prefix": mainPrefix,
}).Error("Error trying to execute GetAndDeleteSet: " + err.Error())
}
log.WithFields(logrus.Fields{
"prefix": mainPrefix,
}).Error("Error trying to execute GetAndDeleteSet: " + err.Error())
return
}
UptimePump.WriteUptimeData(UptimeValues)
}
Expand Down
19 changes: 10 additions & 9 deletions storage/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ import (

// ------------------- REDIS CLUSTER STORAGE MANAGER -------------------------------

var redisClusterSingleton *redisManager
var redisLogPrefix = "redis"
var ENV_REDIS_PREFIX = "TYK_PMP_REDIS"
var ctx = context.Background()
var (
redisClusterSingleton *RedisManager
redisLogPrefix = "redis"
ENV_REDIS_PREFIX = "TYK_PMP_REDIS"
ctx = context.Background()
)

type redisManager struct {
type RedisManager struct {
list list.List
kv keyvalue.KeyValue
conn model.Connector
Expand Down Expand Up @@ -87,13 +89,13 @@ type RedisStorageConfig struct {

// RedisClusterStorageManager is a storage manager that uses the redis database.
type RedisClusterStorageManager struct {
db *redisManager
db *RedisManager
KeyPrefix string
HashKeys bool
Config RedisStorageConfig
}

func NewRedisClusterPool(forceReconnect bool, config *RedisStorageConfig) *redisManager {
func NewRedisClusterPool(forceReconnect bool, config *RedisStorageConfig) *RedisManager {
if !forceReconnect {
if redisClusterSingleton != nil {
log.WithFields(logrus.Fields{
Expand Down Expand Up @@ -164,7 +166,7 @@ func NewRedisClusterPool(forceReconnect bool, config *RedisStorageConfig) *redis
return nil
}

redisClusterSingleton = &redisManager{}
redisClusterSingleton = &RedisManager{}
redisClusterSingleton.kv = kv
redisClusterSingleton.list = l

Expand Down Expand Up @@ -284,7 +286,6 @@ func (r *RedisClusterStorageManager) GetAndDeleteSet(keyName string, chunkSize i
intResult := []interface{}{}
for _, v := range result {
intResult = append(intResult, v)

}

return intResult, nil
Expand Down

0 comments on commit 524fb01

Please sign in to comment.