Skip to content

Commit

Permalink
Add check if the error file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
1josefnevoral committed Aug 30, 2015
1 parent 02995d1 commit e6316d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ composer.lock
tests/temp

.idea
coverage.dat
coverage.dat
.DS_Store
7 changes: 6 additions & 1 deletion src/ErrorCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -77,7 +82,7 @@ public function uploadFiles()
@unlink($filePath);
}
throw $e;
};
}


$cnt++;
Expand Down

0 comments on commit e6316d3

Please sign in to comment.