[libconfig-model-dpkg-perl] 01/03: Dpkg::Dependency: compute cache expiry date only once

dod at debian.org dod at debian.org
Thu Jan 30 18:47:22 UTC 2014


This is an automated email from the git hooks/post-receive script.

dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.

commit 75f1f0b0fc8ac0790b3c31f22b2a85d7ee43c8fd
Author: Dominique Dumont <dod at debian.org>
Date:   Thu Jan 30 19:27:01 2014 +0100

    Dpkg::Dependency: compute cache expiry date only once
---
 lib/Config/Model/Dpkg/Dependency.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/Config/Model/Dpkg/Dependency.pm b/lib/Config/Model/Dpkg/Dependency.pm
index bbb521d..5916cce 100644
--- a/lib/Config/Model/Dpkg/Dependency.pm
+++ b/lib/Config/Model/Dpkg/Dependency.pm
@@ -769,13 +769,14 @@ sub call_cbs {
 
 
 # asynchronous method
+my $cache_expire_date = time - 24 * 60 * 60 * 7 ;
 sub get_available_version {
     my ($self, $callback,$pkg_name) = @_ ;
 
     $async_log->debug("called on $pkg_name");
 
     my ($time, at res) = split / /, ($cache{$pkg_name} || '');
-    if (defined $time and $time =~ /^\d+$/ and $time + 24 * 60 * 60 * 7 > time) {
+    if (defined $time and $time =~ /^\d+$/ and $time > $cache_expire_date ) {
         $async_log->debug("using cached info for $pkg_name");
         $callback->(@res) ;
         return;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git



More information about the Pkg-perl-cvs-commits mailing list