Skip to content

Commit 428a9cc

Browse files
Updated names of all redis functions for clear identification
1 parent 282ac76 commit 428a9cc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

internal/session/redis.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
/* TODO: make the operations below thread safe with mutexes*/
1515

1616
/* store session into Redis database */
17-
func (m *Manager) saveSession(username string) error {
17+
func (m *Manager) saveSessionRedis(username string) error {
1818
ctx := context.Background()
1919

2020
/* thread safety for the manager */
@@ -45,7 +45,7 @@ func (m *Manager) saveSession(username string) error {
4545
}
4646

4747
/* update expiry time in session */
48-
func (m *Manager) updateSessionExpiry(username string) error {
48+
func (m *Manager) updateSessionExpiryRedis(username string) error {
4949

5050
/*
5151
function expects that new expiry time is already set in the session
@@ -82,10 +82,8 @@ func (m *Manager) updateSessionExpiry(username string) error {
8282
return nil
8383
}
8484

85-
/* TODO: Sessions must be marked expired when main.go exits */
86-
8785
/* update status of the session - update and set expired operations will be done with this */
88-
func (m *Manager) updateSessionStatus(username string, status Status) error {
86+
func (m *Manager) updateSessionStatusRedis(username string, status Status) error {
8987

9088
ctx := context.Background()
9189

@@ -116,7 +114,7 @@ func (m *Manager) updateSessionStatus(username string, status Status) error {
116114
}
117115

118116
/* save transaction results to redis */
119-
func (m *Manager) saveTransactionResults(username string, txResult types.Transaction) error {
117+
func (m *Manager) saveTransactionResultsRedis(username string, txResult types.Transaction) error {
120118

121119
ctx := context.Background()
122120

@@ -150,7 +148,7 @@ func (m *Manager) saveTransactionResults(username string, txResult types.Transac
150148
return m.redis.RPush(ctx, key, resultBytes).Err()
151149
}
152150

153-
func (m *Manager) getTransactionResults(username string, limit int) ([]types.TransactionResult, error) {
151+
func (m *Manager) getTransactionResultsRedis(username string, limit int) ([]types.TransactionResult, error) {
154152
ctx := context.Background()
155153

156154
/* thread safety for the manager */

0 commit comments

Comments
 (0)