Cache in-memory objects returned by select()
This commit is contained in:
parent
d2add52424
commit
f210104dda
1 changed files with 9 additions and 0 deletions
|
@ -363,6 +363,15 @@ class kolab_storage_cache
|
||||||
// TODO: post-filter result according to query
|
// TODO: post-filter result according to query
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We don't want to cache big results in-memory, however
|
||||||
|
// if we select only one object here, there's a big chance we will need it later
|
||||||
|
if (!$uids && count($result) == 1) {
|
||||||
|
if ($msguid = $result[0]['_msguid']) {
|
||||||
|
$this->uid2msg[$result[0]['uid']] = $msguid;
|
||||||
|
$this->objects[$msguid] = $result[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue