Commit bb471d07 authored by Byron Jones's avatar Byron Jones

Bug 955962: memcached touched unnecessarily when USE_MEMCACHED is false or no updates made

r=dkl, a=sgreen
parent 7ff7c6c8
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment