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

Flush the Content Writer before closing #787

Merged
merged 1 commit into from
Jun 25, 2023

Conversation

yahavi
Copy link
Member

@yahavi yahavi commented Jun 25, 2023

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.

To enable immediate reading of the generated file, it is advisable to flush the Content Writer before closing it. This can be achieved by invoking the Sync() method on the Content Writer file. Once the content is flushed, the writer can be closed using the close() method. Performing these actions in sequence ensures that any buffered content is immediately written to the file, allowing for seamless reading or subsequent operations on the file, such as moving it.

For example, in the following code snippet, we close the Content Writer and then promptly move the file:
https://github.com/jfrog/jfrog-cli-core/blob/v2.35.0/artifactory/commands/transferfiles/errorshandler.go#L244

@yahavi yahavi added the improvement Automatically generated release notes label Jun 25, 2023
@yahavi yahavi self-assigned this Jun 25, 2023
@yahavi yahavi added the safe to test Approve running integration tests on a pull request label Jun 25, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Jun 25, 2023
@yahavi yahavi merged commit 9177a68 into jfrog:dev Jun 25, 2023
23 of 24 checks passed
@yahavi yahavi deleted the flush-content-writer branch June 25, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Automatically generated release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants