--- a/server/src/app/Console/Commands/ImportCocoonRDF.php Tue Jun 07 01:09:58 2016 +0200
+++ b/server/src/app/Console/Commands/ImportCocoonRDF.php Tue Jun 07 01:11:44 2016 +0200
@@ -97,7 +97,7 @@
$insertTimeouts = 0;
- $documentCounts = ['all' => 0, 'unknown' => 0];
+ $documentCounts = ['all' => 0, 'unknown' => 0, 'error' => 0];
foreach ($recs as $item) {
@@ -130,7 +130,7 @@
$message = $e->getMessage();
$this->info("\nError processing $identifier. code : $code, message: $message");
Log::debug("Error processing $identifier. code : $code, message: $message");
- if($code == 0 && stripos($message, 'timed out')>=0 ) {
+ if($code == 400 || ($code == 0 && stripos($message, 'timed out')>=0) ) {
$this->info("\nTimeout error processing $identifier ($docRdfUrl) : $e, retrying");
Log::warning("Timeout error processing $identifier ($docRdfUrl) : $e, retrying");
continue;
@@ -144,6 +144,7 @@
}
}
if(!$docLoaded) {
+ $documentCounts['error'] += 1;
continue;
}
@@ -249,7 +250,11 @@
$this->info("\nDocument count info: ");
foreach ($documentCounts as $docType => $docCount) {
- $this->info("$docType => $docCount");
+ if($docType == 'error' && $docCount > 0) {
+ $this->error("$docType => $docCount");
+ } else {
+ $this->info("$docType => $docCount");
+ }
}
}
}