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

fix delete binlog bug #1679

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

luky116
Copy link
Collaborator

@luky116 luky116 commented Jul 3, 2023

fix #1671

@@ -133,7 +133,7 @@ int CreatePath(const std::string& path, mode_t mode) {
int GetChildren(const std::string& dir, std::vector<std::string>& result) {
result.clear();
for (auto& de : filesystem::directory_iterator(dir)) {
result.emplace_back(de.path());
result.emplace_back(de.path().filename());
}
return 0;
}
Copy link

Choose a reason for hiding this comment

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

Based on the code patch you provided, here's a brief code review:

  1. Line 133: The change result.emplace_back(de.path().filename()); suggests that instead of adding the complete path to the result vector, only the filename is now being added. This change may be intentional if you only want to store the filenames in the vector. However, if you require the complete paths, you should revert this change.

  2. Error Handling: The current code does not handle any exceptions or errors related to directory operations. It would be beneficial to add appropriate error handling, such as catching exceptions or checking for errors during directory iteration, and handling them accordingly.

  3. Commenting: Consider adding comments or function documentation to explain the purpose and expected behavior of the functions CreatePath() and GetChildren(). This can make the code more understandable for future maintenance or collaboration.

  4. Code Formatting: Make sure that the code adheres to consistent formatting standards throughout for better readability. For example, ensure consistent indentation and style conventions (e.g., using braces even for single-line statements).

  5. Testing: It's essential to thoroughly test the modified code snippet to ensure that the changes work as intended and do not introduce any new bugs. Verify the functionality by running different scenarios and edge cases.

Overall, the changes seem relatively minor, but it's important to carefully evaluate the impact of modifying the original behavior and thoroughly test the code to ensure its correctness.

@chejinge chejinge merged commit 6abf2b5 into OpenAtomFoundation:unstable Jul 3, 2023
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this pull request Jun 8, 2024
cheniujh pushed a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
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.

【问题已回复】目前的代码,binlog文件超出上限不会自动清理
3 participants