From 6a347b5686f025eb29e8b1f917066b25ee1703bc Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 15 Mar 2005 12:41:41 +0000 Subject: [PATCH] Test avec des fork par type de graph a generer --- .../script/graph-statistiques-all.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/telephonie/script/graph-statistiques-all.php b/htdocs/telephonie/script/graph-statistiques-all.php index a0f4eb1efe5..41e7f88620d 100644 --- a/htdocs/telephonie/script/graph-statistiques-all.php +++ b/htdocs/telephonie/script/graph-statistiques-all.php @@ -30,6 +30,7 @@ require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/ProcessGraphContrats.class.ph $childrenTotal = 10; $childrenNow = 0; $clientPerChild = 0; +$contratPerChild = 0; $sql = "SELECT max(s.idp)"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -53,9 +54,8 @@ if ($db->query($sql)) -while ( $childrenNow < $childrenTotal ) +while ( $childrenNow < (2 * $childrenTotal) ) { - $pid = pcntl_fork(); if ( $pid == -1 ) @@ -68,10 +68,16 @@ while ( $childrenNow < $childrenTotal ) } else { - $process = new ProcessGraphClients( $childrenNow, $clientPerChild ); - $process->go(); - $process = new ProcessGraphContrats( $childrenNow, $contratPerChild ); - $process->go(); + if ($childrenNow < 10) + { + $process = new ProcessGraphClients( $childrenNow, $clientPerChild ); + $process->go(); + } + if ($childrenNow >= 10) + { + $process = new ProcessGraphContrats( ($childrenNow - 10), $contratPerChild ); + $process->go(); + } die(); } }