Commit 4b7dc55f authored by Kevin Falcone's avatar Kevin Falcone
Browse files

Merge branch '3.0/makeclicky-cache' into 3.0-trunk

parents 0a73972a d832dab2
......@@ -238,6 +238,29 @@ ${$ARGS{handle}} = sub {
return $handle->(%args);
};
unless (ref $ARGS{cache} && defined ${$ARGS{cache}}) {
${$ARGS{cache}} = sub {
my $type = shift;
my $content = shift;
if ($type eq 'fetch') {
my $parent_args = $m->caller_args(1);
return if $parent_args->{lookup_params};
require Digest::SHA;
return $m->cache->get(Digest::SHA::sha512_base64($$content));
} elsif ($type eq 'store') {
require Digest::SHA;
$m->cache->set(Digest::SHA::sha512_base64($$content),
$$content,
"6 hours");
} else {
RT->Logger->error("Invalid type $type passed to MakeClicky's cache");
}
}
} else {
RT->Logger->info("Someone else defined a MakeClicky cache, skipping ours");
}
%{$ARGS{actions}} = ( %{$ARGS{actions}}, %actions );
push @{$ARGS{types}}, @types;
......
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