diff --git a/lib/SLUB/LZA/Rosetta/TA.pm b/lib/SLUB/LZA/Rosetta/TA.pm index 1d6645c0c1fe19f18cd3d7ac6d678b64d07e6e9c..842997bd971cbbe49f93df856bd39fa15014838f 100644 --- a/lib/SLUB/LZA/Rosetta/TA.pm +++ b/lib/SLUB/LZA/Rosetta/TA.pm @@ -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>) {