diff options
author | Byron Jones <bjones@mozilla.com> | 2014-01-14 05:41:10 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2014-01-14 05:41:10 +0100 |
commit | bb471d076d7f08605c49860c5d3a05cc0c08839a (patch) | |
tree | 857db656fec07b09fff9b58c95cf30e534c8864f | |
parent | 7ff7c6c8add474d9ea46ef7cc6928968d56ce449 (diff) | |
download | bugzilla-bb471d076d7f08605c49860c5d3a05cc0c08839a.tar.gz bugzilla-bb471d076d7f08605c49860c5d3a05cc0c08839a.tar.xz |
Bug 955962: memcached touched unnecessarily when USE_MEMCACHED is false or no updates made
r=dkl, a=sgreen
-rw-r--r-- | Bugzilla/Object.pm | 6 |
1 files changed, 4 insertions, 2 deletions
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; |