diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-17 23:04:29 +0100 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-17 23:04:29 +0100 |
commit | dd670fda9351186a1bf51de2a3b8192a9cda301c (patch) | |
tree | 2a6d8868c9c8db336b665bb029536f490927e16d /lib | |
parent | 92b25824ab4f0d0ba0cc4df195396537eb5f5efb (diff) |
Sentinel file to indicate cache entry complete.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/LXRng/Web.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/LXRng/Web.pm b/lib/LXRng/Web.pm index 126bf9b..78380c8 100644 --- a/lib/LXRng/Web.pm +++ b/lib/LXRng/Web.pm @@ -91,7 +91,7 @@ sub print_markedup_file { $cfile = $context->config->{'cache'}.'/'.$shaid if exists $context->config->{'cache'}; - if ($cfile and -d $cfile) { + if ($cfile and -e "$cfile/.complete") { print("<pre id=\"file_contents\">"); while (-r "$cfile/$line") { print("<div class=\"".($focus ? "done" : "pending"). @@ -160,7 +160,11 @@ sub print_markedup_file { } } print("</div></pre>\n"); - close($cache) if $cache; + if ($cache) { + close($cache); + open($cache, '>', "$cfile/.complete"); + close($cache); + } } return $shaid; } |