File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,14 @@ func (m *Manager) ExpireSession(username string) {
8888 if ! ok {
8989 continue
9090 }
91- txResult .Status = string ( StatusPending )
91+ txResult .Status = types . StatusPending
9292 /* TODO: Push this all into PostgreSQL */
93+ txnPQ , err := ConvertTransactiontoStoreParams (txResult )
94+ if err != nil {
95+ /* error is conversion, continue the loop in good faith */
96+ /* need to handle these errors later */
97+ }
98+ if err == nil { m .archivalPQ .CreateTransactionPQ (context .Background (), txnPQ ) }
9399 }
94100 } else {
95101 /* no empty transactions; mark the session as expired */
@@ -104,11 +110,12 @@ func (m *Manager) ExpireSession(username string) {
104110 /* convert all session parameters to PostgreSQL compatible parameters */
105111 archive , err := ConvertSessionToStoreParams (session )
106112 if err != nil {
107- return
113+ /* session conversion failed, leave it in good faith */
114+ /* handle err later */
108115 }
109116
110117 /* store session to the archive */
111- m .archivalPQ .StoreSessionPQ (context .Background (), * archive )
118+ if err == nil { m .archivalPQ .StoreSessionPQ (context .Background (), * archive ) }
112119
113120 /* remove session from sessionsMap */
114121 delete (m .sessionsMap , username )
You can’t perform that action at this time.
0 commit comments