Merge "[MCR] populateContentTables maintenance script"
[lhc/web/wiklou.git] / includes / libs / rdbms / ChronologyProtector.php
index 72ca590..b0dc10e 100644 (file)
@@ -44,7 +44,7 @@ class ChronologyProtector implements LoggerAwareInterface {
        /** @var string Hash of client parameters */
        protected $clientId;
        /** @var string[] Map of client information fields for logging */
-       protected $clientInfo;
+       protected $clientLogInfo;
        /** @var int|null Expected minimum index of the last write to the position store */
        protected $waitForPosIndex;
        /** @var int Max seconds to wait on positions to appear */
@@ -84,7 +84,11 @@ class ChronologyProtector implements LoggerAwareInterface {
                $this->key = $store->makeGlobalKey( __CLASS__, $this->clientId, 'v2' );
                $this->waitForPosIndex = $posIndex;
 
-               $this->clientInfo = $client + [ 'clientId' => '' ];
+               $this->clientLogInfo = [
+                       'clientIP' => $client['ip'],
+                       'clientAgent' => $client['agent'],
+                       'clientId' => $client['clientId'] ?? null
+               ];
 
                $this->logger = new NullLogger();
        }
@@ -313,7 +317,7 @@ class ChronologyProtector implements LoggerAwareInterface {
                                                [
                                                        'cpPosIndex' => $this->waitForPosIndex,
                                                        'waitTimeMs' => $waitedMs
-                                               ] + $this->clientInfo
+                                               ] + $this->clientLogInfo
                                        );
                                } else {
                                        $this->logger->warning(
@@ -322,7 +326,7 @@ class ChronologyProtector implements LoggerAwareInterface {
                                                        'cpPosIndex' => $this->waitForPosIndex,
                                                        'indexReached' => $indexReached,
                                                        'waitTimeMs' => $waitedMs
-                                               ] + $this->clientInfo
+                                               ] + $this->clientLogInfo
                                        );
                                }
                        } else {