mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-21 16:46:11 +02:00
Switch back to using rpush
Switches back to rpush to keep list order consistent with non capped collections
This commit is contained in:
@@ -75,15 +75,15 @@ class RedisHandler extends AbstractProcessingHandler
|
||||
{
|
||||
if($this->redisClient instanceof \Redis) {
|
||||
$this->redisClient->multi()
|
||||
->lpush($this->redisKey, $record["formatted"])
|
||||
->ltrim($this->redisKey, 0, $this->capSize)
|
||||
->rpush($this->redisKey, $record["formatted"])
|
||||
->ltrim($this->redisKey, -$this->capSize, -1)
|
||||
->execute();
|
||||
} else {
|
||||
$redisKey = $this->redisKey;
|
||||
$capSize = $this->capSize;
|
||||
$this->redisClient->transaction(function($tx) use($record, $redisKey, $capSize) {
|
||||
$tx->lpush($redisKey, $record["formatted"]);
|
||||
$tx->ltrim($redisKey, 0, $capSize);
|
||||
$tx->rpush($redisKey, $record["formatted"]);
|
||||
$tx->ltrim($redisKey, -$capSize, -1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user