aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-11-18 16:18:12 -0200
committerSilvio <silvio@devlet.com.br>2010-11-18 16:18:12 -0200
commit978b0ed546aebbe04cbe364dd050eaec18da5512 (patch)
treedd0017c13ca336b35bfd0782e19100d2ac045673
parentf58eb1685cc0b70e3b09e85c7dfa1d458dfccfc3 (diff)
downloadsf_isis_importer_plugin-978b0ed546aebbe04cbe364dd050eaec18da5512.tar.gz
sf_isis_importer_plugin-978b0ed546aebbe04cbe364dd050eaec18da5512.tar.bz2
Enhancing isis:batch
-rw-r--r--lib/sfIsisImporterManager.class.php1
-rw-r--r--lib/task/isisBatchTask.class.php8
-rw-r--r--lib/task/isisImportTask.class.php2
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/sfIsisImporterManager.class.php b/lib/sfIsisImporterManager.class.php
index aa8ecb8..ebde07b 100644
--- a/lib/sfIsisImporterManager.class.php
+++ b/lib/sfIsisImporterManager.class.php
@@ -133,6 +133,7 @@ class sfIsisImporterManager extends IsisConnector
if ($importer)
{
$this->log("Database $database: ". $importer->isis->entries .' rows.');
+ return $importer->isis->entries;
}
}
}
diff --git a/lib/task/isisBatchTask.class.php b/lib/task/isisBatchTask.class.php
index 95be44c..02cb526 100644
--- a/lib/task/isisBatchTask.class.php
+++ b/lib/task/isisBatchTask.class.php
@@ -27,7 +27,7 @@ EOF;
protected function execute($arguments = array(), $options = array())
{
- // initialize the database connection
+ // Initialize the database connection.
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase($options['connection'])->getConnection();
@@ -46,15 +46,15 @@ EOF;
foreach ($databases as $database)
{
- $rows = (isset($arguments['rows'])) ? $argument['rows'] : 20;
- $max = 1000; // TODO
+ $rows = (isset($arguments['rows'])) ? $argument['rows'] : 100;
+ $max = $isis->info($this, 'task', $database);
for ($offset = 0; $offset <= $max; $offset = $offset + $rows)
{
$pid = pcntl_fork();
if ($pid == -1)
{
- die('Could not fork');
+ die('Could not fork.');
}
else if ($pid)
{
diff --git a/lib/task/isisImportTask.class.php b/lib/task/isisImportTask.class.php
index 124932c..eb8b500 100644
--- a/lib/task/isisImportTask.class.php
+++ b/lib/task/isisImportTask.class.php
@@ -27,7 +27,7 @@ EOF;
protected function execute($arguments = array(), $options = array())
{
- // initialize the database connection
+ // Initialize the database connection.
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase($options['connection'])->getConnection();