[pve-devel] r5720 - pve-access-control/trunk/PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Mar 17 13:16:16 CET 2011


Author: dietmar
Date: 2011-03-17 13:16:15 +0100 (Thu, 17 Mar 2011)
New Revision: 5720

Modified:
   pve-access-control/trunk/PVE/RPCEnvironment.pm
Log:
correctly update tasklist


Modified: pve-access-control/trunk/PVE/RPCEnvironment.pm
===================================================================
--- pve-access-control/trunk/PVE/RPCEnvironment.pm	2011-03-17 11:02:29 UTC (rev 5719)
+++ pve-access-control/trunk/PVE/RPCEnvironment.pm	2011-03-17 12:16:15 UTC (rev 5720)
@@ -38,6 +38,7 @@
 	$pri = 'err';
     }
     PVE::Cluster::log_msg($pri, $user, "end task $upid $msg");
+    PVE::Cluster::broadcast_tasklist(active_workers());
 };
 
 my $worker_reaper = sub {
@@ -433,10 +434,7 @@
 	    die "unable to redirect STDIN - $!" 
 		if !open(STDIN, "</dev/null");
 
-	    if (!$sync) {
-		$outfh = PVE::Tools::upid_open($upid, $wwwid);
-		active_workers($upid);
-	    }
+	    $outfh = PVE::Tools::upid_open($upid, $wwwid) if !$sync;
 
 	    # redirect STDOUT
 	    $fd = fileno(STDOUT);
@@ -523,7 +521,6 @@
 
 	if ($sync) {
 	    $outfh = PVE::Tools::upid_open($upid, $wwwid);
-	    active_workers($upid);
 	}
     };
     my $err = $@;
@@ -540,6 +537,9 @@
     }
 
     PVE::Cluster::log_msg('info', $user, "starting task $upid");
+
+    my $tlist = $self->active_workers($upid);
+    PVE::Cluster::broadcast_tasklist($tlist);
    
     my $res = 0;
 



More information about the pve-devel mailing list