Skip to content

Conversation

lushenle
Copy link

@lushenle lushenle commented Jun 19, 2025

This pull request introduces enhancements to the internal/metric/metric.go file, focusing on error handling and dependency updates. The changes improve the robustness of metrics tracking by accounting for additional error scenarios and updating imports.

Error handling improvements:

  • Modified the TransferCompleted function to increment totalUploads even when the error is io.EOF, ensuring proper metrics tracking for completed transfers despite this specific error condition.

Dependency updates:

  • Added imports for errors and io packages to support the new error handling logic in the TransferCompleted function.Uploads that end with io.EOF are now considered successful and no longer increment the upload error metric. This aligns metric reporting with Go convention, where io.EOF indicates normal completion rather than an error.

Checklist for Pull Requests


Uploads that end with io.EOF are now considered successful and no longer increment the upload error metric.
This aligns metric reporting with Go convention, where io.EOF indicates normal completion rather than an error.
@lushenle lushenle requested a review from drakkan as a code owner June 19, 2025 13:12
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


lushenle seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@drakkan
Copy link
Owner

drakkan commented Jul 20, 2025

If an upload returns EOF, you will have a partial file or no file at all, depending on the storage backend and the SFTPGo configuration

@drakkan drakkan force-pushed the main branch 2 times, most recently from f2c3eb6 to a2d3613 Compare August 19, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants