Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 593c48f

Browse files
committed
Fixed statistics logger
1 parent ca4a9a1 commit 593c48f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Statistics/Logger/RedisStatisticsLogger.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ public function connection($appId)
8686
$incremented = $this->ensureAppIsSet($appId)
8787
->__call('hincrby', [$this->getHash($appId), 'current_connection_count', 1]);
8888

89-
$incremented->then(function ($currentConnectionCount) {
89+
$incremented->then(function ($currentConnectionCount) use ($appId) {
9090
// Get the peak connections count from Redis.
9191
$peakConnectionCount = $this->replicator
9292
->getPublishClient()
9393
->__call('hget', [$this->getHash($appId), 'peak_connection_count']);
9494

95-
$peakConnectionCount->then(function ($currentPeakConnectionCount) use ($currentConnectionCount) {
95+
$peakConnectionCount->then(function ($currentPeakConnectionCount) use ($currentConnectionCount, $appId) {
9696
// Extract the greatest number between the current peak connection count
9797
// and the current connection number.
9898

@@ -120,13 +120,13 @@ public function disconnection($appId)
120120
$decremented = $this->ensureAppIsSet($appId)
121121
->__call('hincrby', [$this->getHash($appId), 'current_connection_count', -1]);
122122

123-
$decremented->then(function ($currentConnectionCount) {
123+
$decremented->then(function ($currentConnectionCount) use ($appId) {
124124
// Get the peak connections count from Redis.
125125
$peakConnectionCount = $this->replicator
126126
->getPublishClient()
127127
->__call('hget', [$this->getHash($appId), 'peak_connection_count']);
128128

129-
$peakConnectionCount->then(function ($currentPeakConnectionCount) use ($currentConnectionCount) {
129+
$peakConnectionCount->then(function ($currentPeakConnectionCount) use ($currentConnectionCount, $appId) {
130130
// Extract the greatest number between the current peak connection count
131131
// and the current connection number.
132132

0 commit comments

Comments
 (0)