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