Adjust Redis data expiration time

This commit is contained in:
2024-09-08 20:07:04 +07:00
parent 2f34be41e5
commit b46915e46d
2 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ func Create(values types.User) (*Session, error) {
return nil, err
}
err = app.Server.Cache.SetCache(context.Background(), "Session:"+id, string(sessionData), time.Hour*24)
err = app.Server.Cache.SetCache(context.Background(), "Session:"+id, string(sessionData), time.Hour*24*7)
if err != nil {
return nil, err
}
@ -106,7 +106,7 @@ func AddSessionInfo(email string, sessionInfo *SessionInfo) error {
return err
}
err = app.Server.Cache.SetCache(context.Background(), "UserSessionInfo:"+email+":"+sessionInfo.SessionID, string(sessionInfoData), 0)
err = app.Server.Cache.SetCache(context.Background(), "UserSessionInfo:"+email+":"+sessionInfo.SessionID, string(sessionInfoData), time.Hour*24*7)
if err != nil {
return err
}