Skip to content
Snippets Groups Projects
Commit 1155465a authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added cache invalidation

- fixes warnings
parent f03c5f04
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ BEGIN{
%config = YAML::LoadFile($config_path);
}
$cache_path = $home->child('.cache')->child('ta-tool.cache');
if ($cache_path->is_file) {
if ($cache_path->is_file and -s $cache_path < 8192*1024) { # if size > 8MB, write new at end, see END{}-block
%cache = YAML::LoadFile($cache_path);
}
}
......@@ -222,13 +222,17 @@ sub trace_log {
return if (
exists( $cache{$file_md5} )
and (
(
exists( $cache{$file_md5}->{deposit_dir}->{$deposit_dir})
and exists( $cache{$file_md5}->{deposit_id}->{$deposit_id})
and exists( $cache{$file_md5}->{sip_id}->{$sip_id})
( exists($cache{$file_md5}->{deposit_dir})
and exists($cache{$file_md5}->{deposit_id})
and exists($cache{$file_md5}->{sip_id})
and exists($cache{$file_md5}->{deposit_dir}->{$searchid})
and exists($cache{$file_md5}->{deposit_id}->{$searchid})
and exists($cache{$file_md5}->{sip_id}->{$searchid})
) or (
exists( $cache{$file_md5}->{ie_pid}->{$ie_pid})
and exists( $cache{$file_md5}->{rep_id}{$rep_id})
exists($cache{$file_md5}->{rep_id})
and exists($cache{$file_md5}->{ie_pid})
and exists($cache{$file_md5}->{ie_pid}->{$searchid})
and exists($cache{$file_md5}->{rep_id}->{$searchid})
)
)
);
......@@ -313,11 +317,11 @@ sub trace_log {
exists( $cache{$file_md5} )
and
(
exists( $cache{$file_md5}->{deposit_dir}->{$deposit_dir})
or exists( $cache{$file_md5}->{deposit_id}->{$deposit_id})
or exists( $cache{$file_md5}->{sip_id}->{$sip_id})
or exists( $cache{$file_md5}->{ie_pid}->{$ie_pid})
or exists( $cache{$file_md5}->{rep_id}->{$rep_id})
(exists ($cache{$file_md5}->{deposit_dir}) and exists($cache{$file_md5}->{deposit_dir}->{$deposit_dir}))
or (exists ($cache{$file_md5}->{deposit_id}) and exists($cache{$file_md5}->{deposit_id}->{$deposit_id}))
or (exists ($cache{$file_md5}->{sip_id}) and exists($cache{$file_md5}->{sip_id}->{$sip_id}))
or (exists ($cache{$file_md5}->{ie_pid}) and exists($cache{$file_md5}->{ie_pid}->{$ie_pid}))
or (exists ($cache{$file_md5}->{rep_id}) and exists($cache{$file_md5}->{rep_id}->{$rep_id}))
)
);
while(<$fh>) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment