Skip to content

Commit

Permalink
Fix revive error
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsanan1 committed Oct 24, 2024
1 parent a2f192a commit 032dd53
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions common-controller/internal/web/notify_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,15 @@ func storeTokenInRedis(token string, expiry int64) error {
err := rdb.Do(context.Background(), "set", key, expiry, "EXAT", expiry).Err()
if err != nil {
loggers.LoggerAPI.Warnf("Error occured while trying to set key with expiry. Error: %+v. \n Trying to use SET and EXPIREAT command...", err)
err1 := rdb.Do(context.Background(), "set", key, expiry).Err()
if err1 != nil {
loggers.LoggerAPI.Errorf("Error occured while setting the key. Error %+v", err1)
err = rdb.Do(context.Background(), "set", key, expiry).Err()
if err != nil {
loggers.LoggerAPI.Errorf("Error occured while setting the key. Error %+v", err)
return err
}
err = rdb.Do(context.Background(), "expireat", key, expiry).Err()
if err != nil {
loggers.LoggerAPI.Errorf("Error occured while setting the expiry. Error %+v", err)
return err
} else {
err1 = rdb.Do(context.Background(), "expireat", key, expiry).Err()
if err1 != nil {
loggers.LoggerAPI.Errorf("Error occured while setting the expiry. Error %+v", err1)
return err
}
}
}
publishValue := fmt.Sprintf("%s%s%d", token, tokenExpiryDivider, expiry)
Expand Down

0 comments on commit 032dd53

Please sign in to comment.