Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlueScreen: renderToFile() returns bool to indicate if file was written by current process #325

Merged
merged 1 commit into from Oct 9, 2018

Conversation

@JanTvrdik
Copy link
Contributor

commented Oct 9, 2018

  • bug fix / new feature? minor low-level feature
  • BC break? no
  • doc PR: too low-level to be worth documenting

I need to upload the bluescreen to remote storage (AWS S3 in my case). This is what I'm doing currently

$lockPath = "$localPath.lock";
$lockHandle = @fopen($lockPath, 'x');
if ($lockHandle === false) {
	return;
}

Tracy\Debugger::getBlueScreen()->renderToFile($exception, $localPath);
$this->remoteStorageDriver->upload($localPath);

@fclose($lockHandle);
@unlink($lockPath);

The proposed change would allow to simplify to code to

if (Tracy\Debugger::getBlueScreen()->renderToFile($exception, $localPath)) {
	$this->remoteStorageDriver->upload($localPath);
}

@dg dg merged commit 2cc4339 into nette:master Oct 9, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 73.557%
Details

@JanTvrdik JanTvrdik deleted the JanTvrdik:patch-2 branch Oct 9, 2018

dg added a commit that referenced this pull request Oct 24, 2018

dg added a commit that referenced this pull request Nov 29, 2018

dg added a commit that referenced this pull request Feb 5, 2019

dg added a commit that referenced this pull request Feb 5, 2019

dg added a commit that referenced this pull request Feb 5, 2019

dg added a commit that referenced this pull request Feb 5, 2019

dg added a commit that referenced this pull request Feb 10, 2019

dg added a commit that referenced this pull request Feb 11, 2019

dg added a commit that referenced this pull request Feb 11, 2019

dg added a commit that referenced this pull request Feb 12, 2019

dg added a commit that referenced this pull request Feb 14, 2019

dg added a commit that referenced this pull request Feb 15, 2019

dg added a commit that referenced this pull request Feb 15, 2019

dg added a commit that referenced this pull request Feb 15, 2019

dg added a commit that referenced this pull request Feb 17, 2019

dg added a commit that referenced this pull request Feb 17, 2019

dg added a commit that referenced this pull request Feb 17, 2019

dg added a commit that referenced this pull request Feb 17, 2019

dg added a commit that referenced this pull request Feb 17, 2019

dg added a commit that referenced this pull request Feb 17, 2019

dg added a commit that referenced this pull request Feb 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.