]> mj.ucw.cz Git - gallery.git/commitdiff
Gallery2: Improved parallelization
authorMartin Mares <mj@ucw.cz>
Sat, 29 Dec 2012 21:43:14 +0000 (22:43 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 8 Feb 2015 20:14:16 +0000 (21:14 +0100)
gal2/gal

index f4f18894bbb75718d03609b9faec4c476293db59..f66c682ee8722dc654474d6be3044b195e425f08 100755 (executable)
--- a/gal2/gal
+++ b/gal2/gal
@@ -75,11 +75,13 @@ while ($running || @dirs) {
        if ($running == $threads || !@dirs) {
                # Wait for children
                my $pid = wait; die if $pid < 0;
+               my $dir = $pid_to_dir{$pid} or die;
                if ($?) {
-                       print "!! ", $pid_to_dir{$pid}, " FAILED";
+                       print "!! $dir FAILED [see $dir/gallery.log]";
                        $errors++;
                } else {
-                       print "++ ", $pid_to_dir{$pid};
+                       print "++ $dir";
+                       unlink "$dir/gallery.log";
                }
                delete $pid_to_dir{$pid};
                $running--;
@@ -101,5 +103,5 @@ while ($running || @dirs) {
        }
 }
 
-print "$done jobs, $errors errors. See gallery.log in subdirectories.\n";
+print "$done jobs, $errors errors.\n";
 exit ($errors > 0);