diff --git a/.gitignore b/.gitignore index b11cad5..13396d4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ composer.lock tests/temp .idea -coverage.dat \ No newline at end of file +coverage.dat +.DS_Store \ No newline at end of file diff --git a/src/ErrorCollector.php b/src/ErrorCollector.php index 6e8226c..11f796a 100644 --- a/src/ErrorCollector.php +++ b/src/ErrorCollector.php @@ -67,6 +67,11 @@ public function uploadFiles() $fileName = $file->getBasename('.log') . '-' . $now->format('Y-m-d-H-i-s') . '.log'; } + if (!is_file($filePath)) { + // some other process already collected it? + continue; + } + try { if ($this->errorStorage->save($fileName, $filePath, $fileType)) { @unlink($filePath); @@ -77,7 +82,7 @@ public function uploadFiles() @unlink($filePath); } throw $e; - }; + } $cnt++;