dbMan/Extension/SuggestionCacheStore.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 11 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 53 CC 3 SCAR 17.5
CC
3
Cov
0%
handle_action
12.0
IDENTIFICATION
2.0
preference
2.0
CRAP 5.8
1 package DBIx::dbMan::Extension::SuggestionCacheStore;
2  
3 use strict;
4 use base 'DBIx::dbMan::Extension';
5  
6 our $VERSION = '0.01';
7  
8 1;
9  
10 sub IDENTIFICATION { return "000001-000096-000001"; }
11  
12 sub preference { return 0; }
13  
14 sub known_actions { return [ qw/CACHE/ ]; }
15  
16 sub handle_action {
17 my ($obj,%action) = @_;
18  
19 $action{processed} = 1;
20  
21 if ($action{action} eq 'CACHE' and $action{oper} eq 'complete' and $action{what} eq 'list') {
22 $action{action} = 'NONE';
23  
24 my $local_mempool = $obj->{-dbi}->mempool();
25 my $cache_type = $action{cache_type} || 'generic';
26  
27 if ( $local_mempool and $local_mempool->get('suggestion_cache') ) {
28 $local_mempool->set('suggestion_cache_content:' . $cache_type, $action{list});
29 }
30  
31 delete $action{processed};
32 }
33  
34 return %action;
35 }