-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
With removeUploads there is a race condition which can result in file with Uploaded to remote storage. being uploaded.
It's because ExecCurlRequestSender is async by default:
monolog-tracy-handler/src/RemoteStorageRequestSenders/ExecCurlRequestSender.php
Lines 15 to 19 in 132e756
| public function __construct(string $curlBinary = 'curl', ?bool $async = null) | |
| { | |
| $this->curlBinary = $curlBinary; | |
| $this->async = $async ?? (PHP_SAPI !== 'cli'); | |
| } |
And TracyHandler replaces the content immediately.
monolog-tracy-handler/src/TracyHandler.php
Lines 57 to 64 in 132e756
| if ($blueScreen->renderToFile($exception, $localPath)) { | |
| if ($this->remoteStorageDriver !== null) { | |
| $uploaded = $this->remoteStorageDriver->upload($localPath); | |
| if ($uploaded && $this->removeUploads) { | |
| @file_put_contents($localPath, self::UPLOADED_FILE_CONTENTS); | |
| } | |
| } | |
| } |
JanTvrdik
Metadata
Metadata
Assignees
Labels
No labels