Remove unused method, update dependencies
This commit is contained in:
15
src/redis.go
15
src/redis.go
@@ -2,7 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
@@ -123,20 +122,6 @@ func (r *Redis) Set(key string, value interface{}, ttl time.Duration) error {
|
||||
return r.Client.Set(ctx, key, value, ttl).Err()
|
||||
}
|
||||
|
||||
func (r *Redis) SetJSON(key string, value interface{}, ttl time.Duration) error {
|
||||
if !r.Enabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
data, err := json.Marshal(value)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return r.Set(key, data, ttl)
|
||||
}
|
||||
|
||||
func (r *Redis) Close() error {
|
||||
if !r.Enabled {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user