From bb471d076d7f08605c49860c5d3a05cc0c08839a Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 14 Jan 2014 12:41:10 +0800 Subject: Bug 955962: memcached touched unnecessarily when USE_MEMCACHED is false or no updates made r=dkl, a=sgreen --- Bugzilla/Object.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index a31392353..c4dfe8cf7 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; -- cgit v1.2.3-24-g4f1b