Skip to content

🚀 Optimize Menno data download and processing workflow#1939

Merged
mkmccarty merged 1 commit intomainfrom
mm-branch-1
Dec 13, 2025
Merged

🚀 Optimize Menno data download and processing workflow#1939
mkmccarty merged 1 commit intomainfrom
mm-branch-1

Conversation

@mkmccarty
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 13, 2025 07:19
@mkmccarty mkmccarty merged commit bf4272d into main Dec 13, 2025
9 checks passed
@mkmccarty mkmccarty deleted the mm-branch-1 branch December 13, 2025 07:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to optimize the Menno data download and processing workflow by adding a file existence check to avoid redundant downloads, moving the CSV path construction earlier in the function, and cleaning up commented-out code.

Key changes:

  • Added file existence check before processing to skip download if CSV already exists
  • Moved CSV path construction earlier in the function flow
  • Removed commented-out code and unnecessary comments

Comment thread src/menno/menno.go
Comment on lines +128 to +132
if _, err := os.Stat(csvPath); err == nil {
log.Printf("CSV file already exists, skipping download: %s", csvPath)
return // Skip download if the file exists
}

Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This early return skips the entire data processing pipeline when the CSV file exists. The function should not only download the file but also process it and populate the database. The file existence check at line 128 returns early, preventing the CSV from being read and the database from being populated (lines 139-244).

The retrieveMennoData function already handles file existence checks appropriately (line 75), so this additional check is redundant and breaks the intended workflow. If the goal is to avoid re-downloading, the existing logic in retrieveMennoData already provides this optimization.

Suggested change
if _, err := os.Stat(csvPath); err == nil {
log.Printf("CSV file already exists, skipping download: %s", csvPath)
return // Skip download if the file exists
}
// (File existence is handled in retrieveMennoData; do not return early here.)

Copilot uses AI. Check for mistakes.
@mkmccarty
Copy link
Copy Markdown
Owner Author

@copilot open a new pull request to apply changes based on the comments in this thread

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.

2 participants