Code Duplication    Length = 8-9 lines in 2 locations

includes/libs/redis/RedisConnRef.php 2 locations

@@ 137-145 (lines=9) @@
134
		// multi()/pipeline() and (b) some connection problem likely occurred. If
135
		// the password the client gave was just wrong, an exception should have
136
		// been thrown back in getConnection() previously.
137
		if ( preg_match( '/^ERR operation not permitted\b/', $conn->getLastError() ) ) {
138
			$this->pool->reauthenticateConnection( $server, $conn );
139
			$conn->clearLastError();
140
			$res = $conn->eval( $script, $params, $numKeys );
141
			$this->logger->info(
142
				"Used automatic re-authentication for Lua script '$sha1'.",
143
				[ 'redis_server' => $server ]
144
			);
145
		}
146
		// If the script is not in cache, use eval() to retry and cache it
147
		if ( preg_match( '/^NOSCRIPT/', $conn->getLastError() ) ) {
148
			$conn->clearLastError();
@@ 147-154 (lines=8) @@
144
			);
145
		}
146
		// If the script is not in cache, use eval() to retry and cache it
147
		if ( preg_match( '/^NOSCRIPT/', $conn->getLastError() ) ) {
148
			$conn->clearLastError();
149
			$res = $conn->eval( $script, $params, $numKeys );
150
			$this->logger->info(
151
				"Used eval() for Lua script '$sha1'.",
152
				[ 'redis_server' => $server ]
153
			);
154
		}
155
156
		if ( $conn->getLastError() ) { // script bug?
157
			$this->logger->error(