Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
best-practical
rtir
Commits
4b7dc55f
Commit
4b7dc55f
authored
May 01, 2014
by
Kevin Falcone
Browse files
Merge branch '3.0/makeclicky-cache' into 3.0-trunk
parents
0a73972a
d832dab2
Changes
1
Hide whitespace changes
Inline
Side-by-side
html/Callbacks/RTIR/Elements/MakeClicky/Default
View file @
4b7dc55f
...
...
@@ -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;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment