Upsteam sync
This commit is contained in:
@@ -37,6 +37,7 @@ db = 0
|
||||
pass = "3rdaP3KL2x%V"
|
||||
prefix = "nemt-portal-api-dev"
|
||||
default-expiration = "5m"
|
||||
master-name = "devmaster01"
|
||||
|
||||
[log]
|
||||
log-to-file = false
|
||||
|
||||
@@ -37,6 +37,7 @@ db = 0
|
||||
pass = "3rdaP3KL2x%V"
|
||||
prefix = "portal-api-prod"
|
||||
default-expiration = "5m"
|
||||
master-name = "master01"
|
||||
|
||||
[log]
|
||||
log-to-file = false
|
||||
|
||||
@@ -37,6 +37,7 @@ db = 0
|
||||
pass = "3rdaP3KL2x%V"
|
||||
prefix = "portal-api-test"
|
||||
default-expiration = "5m"
|
||||
master-name = "devmaster01"
|
||||
|
||||
[log]
|
||||
log-to-file = false
|
||||
|
||||
@@ -80,7 +80,9 @@ func (c *notificationRepo) getQuery() string {
|
||||
INNER JOIN tab_login e
|
||||
ON c.user_id = e.user_id
|
||||
INNER JOIN tab_login f
|
||||
ON d.user_id = f.user_id`
|
||||
ON d.user_id = f.user_id
|
||||
INNER JOIN tab_ride g
|
||||
ON g.ride_id = a.ride_id `
|
||||
}
|
||||
|
||||
func (c *notificationRepo) GetLastNotificationFromPhoneNumber(notificationType string, phoneNumber string, status string) (entity.Notification, error) {
|
||||
|
||||
3
infra/cache/cache.go
vendored
3
infra/cache/cache.go
vendored
@@ -31,10 +31,11 @@ type RedisCache struct {
|
||||
func Instance(cfg *config.Config) contract.CacheManager {
|
||||
once.Do(func() {
|
||||
client := redis.NewFailoverClient(&redis.FailoverOptions{
|
||||
MasterName: "master01",
|
||||
MasterName: cfg.Cache.Master,
|
||||
SentinelAddrs: []string{fmt.Sprintf("%s:%v", cfg.Cache.Server, cfg.Cache.Port)},
|
||||
Password: cfg.Cache.Pass,
|
||||
DB: cfg.Cache.DB,
|
||||
MaxRetries: 10,
|
||||
})
|
||||
|
||||
instance = &RedisCache{cfg, client}
|
||||
|
||||
@@ -120,6 +120,7 @@ type CacheConfig struct {
|
||||
Pass string
|
||||
Prefix string
|
||||
DefaultExpiration time.Duration
|
||||
Master string
|
||||
}
|
||||
|
||||
// CacheConfig represents the configuration values about the documentation config.
|
||||
@@ -199,6 +200,7 @@ func Read() (*Config, error) {
|
||||
Pass: viper.GetString("cache.pass"),
|
||||
Prefix: viper.GetString("cache.prefix"),
|
||||
DefaultExpiration: viper.GetDuration("cache.default-expiration"),
|
||||
Master: viper.GetString("cache.master-name"),
|
||||
},
|
||||
Lyft: LyftConfig{
|
||||
Client: viper.GetString("lyft.key"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func SetMiddlewares(server *echo.Echo, cfg *config.Config, log *logger.Logger, s
|
||||
setCORSMiddleware(server, cfg)
|
||||
setBodyLimitMiddleware(server)
|
||||
setRateLimitMiddleware(server)
|
||||
setAuthorizationMiddleware(server, log, cfg, appsvc)
|
||||
//setAuthorizationMiddleware(server, log, cfg, appsvc)
|
||||
|
||||
err := setJWTMiddleware(server, cfg)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user