diff options
author | David Lawrence <dkl@redhat.com> | 2014-05-29 16:20:08 +0200 |
---|---|---|
committer | David Lawrence <dkl@redhat.com> | 2014-05-29 16:20:08 +0200 |
commit | 775b7cc8b474b31f4315d4f714acddac96e73b7a (patch) | |
tree | 92bf4c4b34bb573b531bc7a95c1ff412a44ea24f /Bugzilla/Memcached.pm | |
parent | 1af952ceaa1c06a10e0eeb6f139e5a5652002e98 (diff) | |
parent | 24a16ae497460834719d6214a7e73ecc7982f9fa (diff) | |
download | bugzilla-775b7cc8b474b31f4315d4f714acddac96e73b7a.tar.gz bugzilla-775b7cc8b474b31f4315d4f714acddac96e73b7a.tar.xz |
Merge remote branch 'origin/master'
Diffstat (limited to 'Bugzilla/Memcached.pm')
-rw-r--r-- | Bugzilla/Memcached.pm | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Bugzilla/Memcached.pm b/Bugzilla/Memcached.pm index 7a9734375..28934e4f5 100644 --- a/Bugzilla/Memcached.pm +++ b/Bugzilla/Memcached.pm @@ -106,7 +106,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", @@ -119,7 +119,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", @@ -167,9 +167,14 @@ sub clear_all { } sub clear_config { - my ($self) = @_; + my ($self, $args) = @_; return unless $self->{memcached}; - $self->_inc_prefix("config"); + if ($args && exists $args->{key}) { + $self->_delete($self->_config_prefix . '.' . $args->{key}); + } + else { + $self->_inc_prefix("config"); + } } # in order to clear all our keys, we add a prefix to all our keys. when we @@ -221,7 +226,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; @@ -426,6 +431,11 @@ corresponding C<table> and C<name> entry. Removes C<value> with the specified C<table> and C<name>, as well as the corresponding C<table> and C<id> entry. +=item C<clear_config({ key =E<gt> $key })> + +Remove C<value> with the specified C<key> from the configuration cache. See +C<set_config> for more information. + =item C<clear_config> Removes all configuration related values from the cache. See C<set_config> for |