Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/redis #18

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cfgldr/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type Redis struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
Password string `mapstructure:"password"`
Dbnum int `mapstructure:"dbnum"`
}

type Config struct {
Expand Down
1 change: 0 additions & 1 deletion config/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ redis:
host: localhost
port: 6379
password: ""
dbnum: 0
2 changes: 1 addition & 1 deletion database/redis.connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package database

import (
"fmt"

"github.com/isd-sgcu/johnjud-auth/cfgldr"
"github.com/pkg/errors"
"github.com/redis/go-redis/v9"
Expand All @@ -13,7 +14,6 @@ func InitRedisConnection(conf *cfgldr.Redis) (*redis.Client, error) {
cache := redis.NewClient(&redis.Options{
Addr: addr,
Password: conf.Password,
DB: conf.Dbnum,
})

if cache == nil {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
volumes:
- postgres:/var/lib/postgresql/data
ports:
- "5433:5432"
- "5432:5432"
cache:
image: redis
restart: unless-stopped
Expand Down
Loading