projects
/
webmin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c113667
)
Do in-memory caching too
author
Jamie Cameron
<jcameron@webmin.com>
Mon, 7 Dec 2009 05:57:14 +0000
(21:57 -0800)
committer
Jamie Cameron
<jcameron@webmin.com>
Mon, 7 Dec 2009 05:57:14 +0000
(21:57 -0800)
package-updates/package-updates-lib.pl
patch
|
blob
|
history
diff --git
a/package-updates/package-updates-lib.pl
b/package-updates/package-updates-lib.pl
index
078c19f
..
bbccb7a
100644
(file)
--- a/
package-updates/package-updates-lib.pl
+++ b/
package-updates/package-updates-lib.pl
@@
-144,13
+144,20
@@
my ($file, $arr) = @_;
&open_tempfile(FILE, ">$file");
&print_tempfile(FILE, Dumper($arr));
&close_tempfile(FILE);
+$read_cache_file_cache{$file} = $arr;
}
+# read_cache_file(file)
+# Returns the contents of some cache file, as an array ref
sub read_cache_file
{
my ($file) = @_;
+if (defined($read_cache_file_cache{$file})) {
+ return @{$read_cache_file_cache{$file}};
+ }
if (-r $file) {
do $file;
+ $read_cache_file_cache{$file} = $VAR1;
return @$VAR1;
}
return ( );