only encache new objects when insert was successful

This commit is contained in:
Evan Prodromou 2010-01-06 16:34:18 -10:00
parent 35d4587172
commit e50410683f
1 changed files with 3 additions and 1 deletions

View File

@ -143,7 +143,9 @@ class Memcached_DataObject extends DB_DataObject
function insert() function insert()
{ {
$result = parent::insert(); $result = parent::insert();
if ($result) {
$this->encache(); // in case of cached negative lookups $this->encache(); // in case of cached negative lookups
}
return $result; return $result;
} }