From 6d730fae2211b9319037b7cb0515351fa529e78c Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 28 May 2014 13:53:48 +0800 Subject: Bug 993939: Bugzilla::User::Setting::groups() should use memcached r=dkl, a=justdave --- Bugzilla/Memcached.pm | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'Bugzilla/Memcached.pm') diff --git a/Bugzilla/Memcached.pm b/Bugzilla/Memcached.pm index 2bf7f1393..819b6d8b6 100644 --- a/Bugzilla/Memcached.pm +++ b/Bugzilla/Memcached.pm @@ -104,7 +104,7 @@ sub set_config { return unless $self->{memcached}; if (exists $args->{key}) { - return $self->_set($self->_config_prefix . ':' . $args->{key}, $args->{data}); + return $self->_set($self->_config_prefix . '.' . $args->{key}, $args->{data}); } else { ThrowCodeError('params_required', { function => "Bugzilla::Memcached::set_config", @@ -117,7 +117,7 @@ sub get_config { return unless $self->{memcached}; if (exists $args->{key}) { - return $self->_get($self->_config_prefix . ':' . $args->{key}); + return $self->_get($self->_config_prefix . '.' . $args->{key}); } else { ThrowCodeError('params_required', { function => "Bugzilla::Memcached::get_config", @@ -165,9 +165,14 @@ sub clear_all { } sub clear_config { - my ($self) = @_; - return unless $self->{memcached}; - $self->_inc_prefix("config"); + my ($self, $args) = @_; + if ($args && exists $args->{key}) { + $self->_delete($self->_config_prefix . '.' . $args->{key}); + } + else { + return unless $self->{memcached}; + $self->_inc_prefix("config"); + } } # in order to clear all our keys, we add a prefix to all our keys. when we @@ -214,7 +219,7 @@ sub _config_prefix { sub _encode_key { my ($self, $key) = @_; - $key = $self->_global_prefix . ':' . uri_escape_utf8($key); + $key = $self->_global_prefix . '.' . uri_escape_utf8($key); return length($self->{namespace} . $key) > MAX_KEY_LENGTH ? undef : $key; @@ -419,6 +424,11 @@ corresponding C and C entry. Removes C with the specified C
and C, as well as the corresponding C
and C entry. +=item C $key })> + +Remove C with the specified C from the configuration cache. See +C for more information. + =item C Removes all configuration related values from the cache. See C for -- cgit v1.2.3-24-g4f1b