From: Byron Jones Date: Tue, 14 Jan 2014 04:41:10 +0000 (+0800) Subject: Bug 955962: memcached touched unnecessarily when USE_MEMCACHED is false or no updates... X-Git-Tag: bugzilla-4.5.2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb471d076d7f08605c49860c5d3a05cc0c08839a;p=thirdparty%2Fbugzilla.git Bug 955962: memcached touched unnecessarily when USE_MEMCACHED is false or no updates made r=dkl, a=sgreen --- diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index a31392353d..c4dfe8cf7f 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -496,7 +496,8 @@ sub update { $self->audit_log(\%changes) if $self->AUDIT_UPDATES; $dbh->bz_commit_transaction(); - Bugzilla->memcached->clear({ table => $table, id => $self->id }); + Bugzilla->memcached->clear({ table => $table, id => $self->id }) + if $self->USE_MEMCACHED && @values; $self->_object_cache_remove({ id => $self->id }); $self->_object_cache_remove({ name => $self->name }) if $self->name; @@ -517,7 +518,8 @@ sub remove_from_db { $self->audit_log(AUDIT_REMOVE) if $self->AUDIT_REMOVES; $dbh->do("DELETE FROM $table WHERE $id_field = ?", undef, $self->id); $dbh->bz_commit_transaction(); - Bugzilla->memcached->clear({ table => $table, id => $self->id }); + Bugzilla->memcached->clear({ table => $table, id => $self->id }) + if $self->USE_MEMCACHED; $self->_object_cache_remove({ id => $self->id }); $self->_object_cache_remove({ name => $self->name }) if $self->name; undef $self;