Skip to content

Commit

Permalink
fix predis logging using symfony cache component
Browse files Browse the repository at this point in the history
  • Loading branch information
vchebotarev authored and curry684 committed Apr 11, 2018
1 parent e43b593 commit cfa9503
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Client/Predis/Connection/ConnectionWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@ public function isConnected()
*/
public function writeRequest(CommandInterface $command)
{
return $this->connection->writeRequest($command);
if (null === $this->logger) {
$this->connection->writeRequest($command);
return;
}

$startTime = microtime(true);
$this->connection->writeRequest($command);
$duration = (microtime(true) - $startTime) * 1000;

$this->logger->logCommand($this->commandToString($command), $duration, $this->getParameters()->alias);
}

/**
Expand Down

0 comments on commit cfa9503

Please sign in to comment.