Centralized the cache expiration times

Signed-off-by: Ethan Wellenreiter <ewellenreiter@gmail.com>
This commit is contained in:
Ethan Wellenreiter 2025-05-06 23:52:15 -04:00
parent 3bf0d93af2
commit 29bf0bec88

View File

@ -4,9 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"time"
// auth_storage "git.ewellenr.ca/receipt_indexer/backend/internal/storage/auth"
"git.ewellenr.ca/receipt_indexer/backend/internal/storage"
"github.com/redis/go-redis/v9"
)
@ -15,8 +13,6 @@ type UserStore struct {
rdb *redis.Client
}
const UserExpTime = time.Minute
func (s *UserStore) Get(ctx context.Context, userID int64) (*storage.User, error) {
cacheKey := fmt.Sprintf("user-%d", userID)