-
Notifications
You must be signed in to change notification settings - Fork 0
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
Remove Non-Zip File from SFTP Sever #176
Conversation
…f a non-zip file Co-authored-by: saquino0827 <saquino@flexion.us> Co-authored-by: James Herr <jherr@flexion.us> Co-authored-by: jcrichlake <145698165+jcrichlake@users.noreply.github.com> Co-authored-by: Sylvie <sschuresko@flexion.us>
Co-authored-by: saquino0827 <saquino@flexion.us> Co-authored-by: James Herr <jherr@flexion.us> Co-authored-by: jcrichlake <145698165+jcrichlake@users.noreply.github.com> Co-authored-by: Sylvie <sschuresko@flexion.us>
Quality Gate passedIssues Measures |
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
if err != nil { | ||
slog.Error("Failed to remove file from local server", slog.Any(utils.ErrorKey, err), slog.String("name", fileInfo.Name())) | ||
//delete file from local filesystem | ||
err = os.Remove(fileInfo.Name()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a defer statement to handle file cleanup in a more reliable way. This ensures that the file is always removed regardless of where the function exits due to an error. [important]
Remove Non-Zip File from SFTP Sever
Description
Refactored copySingleFile to prevent early returning for a non-zip file when removing file from sftp server. Updated docker-compose to have consistent starting directory for sftp server. Tested locally to ensure that non-zip is ingested and deleted.
Issue
CDCgov/trusted-intermediary#1337
Checklist
Note: You may remove items that are not applicable