[HOTFIX] Dont schedule tasks if already queued#2885
Conversation
Summary of ChangesHello @gantoine, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This hotfix addresses an issue where tasks could be redundantly scheduled even if they were already present in a processing queue. The primary goal is to ensure task uniqueness by extending the check for existing jobs to include both the main task scheduler and the low-priority queue, thereby preventing unnecessary re-scheduling and potential resource waste. A new unit test has been added to validate this behavior. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a hotfix to prevent tasks from being scheduled if they are already present in the low_prio_queue. The core logic change in tasks.py is sound and is accompanied by a well-written unit test in test_prevent_requeue.py. My main feedback includes a suggestion for a minor performance improvement in tasks.py. Additionally, I've noticed that the changes in test_scan_library.py seem unrelated to the hotfix's purpose and should ideally be submitted in a separate pull request to maintain a clean and focused commit history.
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a hotfix to prevent scheduling tasks that are already present in the queue. The core logic change in tasks.py correctly checks both the scheduler and the queue for existing jobs, which effectively solves the issue. It's great to see that a new test file has been added to verify this behavior. I've provided a couple of suggestions in the tests to enhance maintainability, but overall, this is a well-executed fix.
Description
Explain the changes or enhancements you are proposing with this pull request.
Checklist
Please check all that apply.