Skip to content

Commit

Permalink
Refactored code for connectionResumeorRecoverAttempt
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Oct 28, 2023
1 parent 8d11288 commit a64a479
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ably/realtime_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,9 @@ func (c *Connection) eventloop() {
case actionConnected:
c.mtx.Lock()

// recover is used when set via clientOptions#recover initially, resume will be used for all subsequent requests.
isConnectionResumeOrRecoverAttempt := !empty(c.key) || !empty(c.opts.Recover)

Check failure on line 797 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / check (1.19)

isConnectionResumeOrRecoverAttempt declared but not used

Check failure on line 797 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / integration-test (1.19, json)

isConnectionResumeOrRecoverAttempt declared but not used

Check failure on line 797 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / check (1.20)

isConnectionResumeOrRecoverAttempt declared and not used

Check failure on line 797 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / integration-test (1.19, msgpack)

isConnectionResumeOrRecoverAttempt declared but not used

Check failure on line 797 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / integration-test (1.20, json)

isConnectionResumeOrRecoverAttempt declared and not used

Check failure on line 797 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / integration-test (1.20, msgpack)

isConnectionResumeOrRecoverAttempt declared and not used

// we need to get this before we set c.key so as to be sure if we were
// resuming or recovering the connection.
mode := c.getMode()
Expand Down Expand Up @@ -823,9 +826,6 @@ func (c *Connection) eventloop() {
c.id = msg.ConnectionID
isNewID := previousID != msg.ConnectionID

// recover is used when set via clientOptions#recover initially, resume will be used for all subsequent requests.
isConnectionResumeOrRecoverAttempt := !empty(c.key) || !empty(c.opts.Recover)

failedResumeOrRecover := isNewID && msg.Error != nil // RTN15c7, RTN16d

Check failure on line 829 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / check (1.19)

failedResumeOrRecover declared but not used

Check failure on line 829 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / integration-test (1.19, json)

failedResumeOrRecover declared but not used

Check failure on line 829 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / check (1.20)

failedResumeOrRecover declared and not used

Check failure on line 829 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / integration-test (1.19, msgpack)

failedResumeOrRecover declared but not used

Check failure on line 829 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / integration-test (1.20, json)

failedResumeOrRecover declared and not used

Check failure on line 829 in ably/realtime_conn.go

View workflow job for this annotation

GitHub Actions / integration-test (1.20, msgpack)

failedResumeOrRecover declared and not used

if reconnecting && mode == recoveryMode && msg.Error == nil {
Expand Down

0 comments on commit a64a479

Please sign in to comment.