),
);
+
var $max_pool_size = 10;
var $table = 'core_notify';
//echo "BATCH SIZE: ". count($ar) . "\n";
$pushed = array();
+ $requeue = array();
while (true) {
break;
}
$ar = $pushed;
- $pushed = array();
+ $pushed = false;
continue;
}
}
if ($this->poolHasDomain($p->person_id_email)) {
+ if ($pushed === false) {
+ // we only try once to requeue..
+ $requeue[] = $p;
+ continue;
+ }
$pushed[] = $p;
sleep(3);
}
+
+ foreach($requeue as $p) {
+ $pp = clone($p);
+ $p->event_when = strtotime($p->event_when . ' + 1 MINUTE');
+ $p->update($pp);
+
+ }
+
+
+
die("DONE\n");
}
function run($id, $email, $cmdOpts="")
{
- // phpinfo();exit;
+
+ static $renice = fase;
+ if (!$renice) {
+ require_once 'System.php';
+ $renice = System::which('renice');
+ }
+
+ // phpinfo();exit;
$tn = tempnam(ini_get('session.save_path'),'stdout') . '.stdout';
$descriptorspec = array(
0 => array("pipe", 'r'), // stdin is a pipe that the child will read from
echo "call proc_open $cmd\n";
+ if ($this->max_pool_size === 1) {
+ passthru($cmd);
+ return;
+ }
+
+
if (!empty($this->opts['dryrun'])) {
echo "DRY RUN\n";
return;