From 1f02aba7907f081c7b9680dc7ec2c27eb0a8c812 Mon Sep 17 00:00:00 2001 From: Nicolas Rochelemagne Date: Thu, 20 Dec 2012 14:08:42 -0600 Subject: [PATCH] any Cache::Cache calls expect to retrieve an object --- plugins/node.d/memcached_.in | 8 ++++++-- plugins/node.d/mysql_.in | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/node.d/memcached_.in b/plugins/node.d/memcached_.in index f18f41f..ebc56e3 100644 --- a/plugins/node.d/memcached_.in +++ b/plugins/node.d/memcached_.in @@ -228,8 +228,12 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { } exit 0; } -my $mc = new Cache::Memcached { 'servers' => [ "$HOST:$PORT" ] }; -my $stats = $mc->stats ('misc'); +my $stats; +{ + local $Storable::flags = 6; + my $mc = new Cache::Memcached { 'servers' => [ "$HOST:$PORT" ] }; + $stats = $mc->stats ('misc'); +} foreach my $k ( sort(keys %vars) ) { if($k eq 'master') { next; } diff --git a/plugins/node.d/mysql_.in b/plugins/node.d/mysql_.in index 3d35d28..40a537c 100755 --- a/plugins/node.d/mysql_.in +++ b/plugins/node.d/mysql_.in @@ -160,6 +160,7 @@ my %cache_options = ( my $shared_memory_cache ; if ($has_cache) { + local $Storable::flags = 6; $shared_memory_cache = Cache::SharedMemoryCache->new(\%cache_options) or die("Couldn't instantiate SharedMemoryCache"); } @@ -896,6 +897,7 @@ sub db_connect { sub update_data { + local $Storable::flags = 6; $data = $shared_memory_cache->get('data'); return if $data; -- 1.7.5