@@ -86,13 +86,13 @@ public function connection($appId)
86
86
$ incremented = $ this ->ensureAppIsSet ($ appId )
87
87
->__call ('hincrby ' , [$ this ->getHash ($ appId ), 'current_connection_count ' , 1 ]);
88
88
89
- $ incremented ->then (function ($ currentConnectionCount ) {
89
+ $ incremented ->then (function ($ currentConnectionCount ) use ( $ appId ) {
90
90
// Get the peak connections count from Redis.
91
91
$ peakConnectionCount = $ this ->replicator
92
92
->getPublishClient ()
93
93
->__call ('hget ' , [$ this ->getHash ($ appId ), 'peak_connection_count ' ]);
94
94
95
- $ peakConnectionCount ->then (function ($ currentPeakConnectionCount ) use ($ currentConnectionCount ) {
95
+ $ peakConnectionCount ->then (function ($ currentPeakConnectionCount ) use ($ currentConnectionCount, $ appId ) {
96
96
// Extract the greatest number between the current peak connection count
97
97
// and the current connection number.
98
98
@@ -120,13 +120,13 @@ public function disconnection($appId)
120
120
$ decremented = $ this ->ensureAppIsSet ($ appId )
121
121
->__call ('hincrby ' , [$ this ->getHash ($ appId ), 'current_connection_count ' , -1 ]);
122
122
123
- $ decremented ->then (function ($ currentConnectionCount ) {
123
+ $ decremented ->then (function ($ currentConnectionCount ) use ( $ appId ) {
124
124
// Get the peak connections count from Redis.
125
125
$ peakConnectionCount = $ this ->replicator
126
126
->getPublishClient ()
127
127
->__call ('hget ' , [$ this ->getHash ($ appId ), 'peak_connection_count ' ]);
128
128
129
- $ peakConnectionCount ->then (function ($ currentPeakConnectionCount ) use ($ currentConnectionCount ) {
129
+ $ peakConnectionCount ->then (function ($ currentPeakConnectionCount ) use ($ currentConnectionCount, $ appId ) {
130
130
// Extract the greatest number between the current peak connection count
131
131
// and the current connection number.
132
132
0 commit comments