mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
VolatileStateResults: Fetch individual redis results for the actual current item
Previously, only the second and other subsequent item was updated with redis
results. Not sure why this wasn't discovered until recently, as the issue
was already part of the initial fix meant for a very similar issue, affecting
*all* items. Hell, maybe because my initial analysis this time also led me
into the wrong direction, so when reviewing this, proper testing and result
verification is key!
fixes #1318
(cherry picked from commit f70f60bf66)
This commit is contained in:
parent
0589146756
commit
2963fd60b8
1 changed files with 4 additions and 9 deletions
|
|
@ -84,6 +84,10 @@ class VolatileStateResults extends ResultSet
|
|||
}
|
||||
|
||||
$result = parent::current();
|
||||
if ($this->isCacheDisabled && ! $this->redisUnavailable) {
|
||||
$this->applyRedisUpdates([$result]);
|
||||
}
|
||||
|
||||
if (! $this->includeModelID) {
|
||||
unset($result['id']);
|
||||
}
|
||||
|
|
@ -91,15 +95,6 @@ class VolatileStateResults extends ResultSet
|
|||
return $result;
|
||||
}
|
||||
|
||||
public function next(): void
|
||||
{
|
||||
parent::next();
|
||||
|
||||
if (! $this->redisUnavailable && $this->isCacheDisabled && $this->valid()) {
|
||||
$this->applyRedisUpdates([parent::current()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function key(): int
|
||||
{
|
||||
if (! $this->redisUnavailable && ! $this->updatesApplied && ! $this->isCacheDisabled) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue