Skip to content

Conversation

@LuisJG8
Copy link
Owner

@LuisJG8 LuisJG8 commented Jan 30, 2026

added concurrency to celery in docker_compose.yml to run multiple tasks in parallel, before it was set up as pool=solo this will only allow Celery to run multiple tasks in parallel

…ks in parallel, before it was set up as pool=solo this will only allow Celery to run multiple tasks in parallel
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @LuisJG8, 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 pull request primarily focuses on enhancing the performance and robustness of the Celery worker setup. It improves task parallelism by adjusting the Celery configuration in Docker Compose and refines the handling of GitHub API rate limits within the data fetching logic. Additionally, it includes minor code cleanup by commenting out unused or non-functional code.

Highlights

  • Celery Concurrency: The Celery worker in docker-compose.yml has been updated to remove the pool=solo setting and increase the --concurrency from 4 to 8, allowing for more parallel task execution.
  • GitHub API Rate Limit Handling: The get_github_data task in worker.py now checks remaining_api_calls == 1 instead of counter >= 500 to determine when to break the data fetching loop, providing a more accurate rate limit check.
  • Code Cleanup: An 'old code that did not work' section, specifically the distribute_tasks function, has been commented out in worker.py.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@LuisJG8 LuisJG8 merged commit c79352c into MyProjects Jan 30, 2026
1 check failed
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to enable concurrency for Celery workers by updating the "docker-compose.yml" file. However, it introduces a critical logic error in "worker.py" where a broken rate-limit check can lead to an infinite loop, causing memory exhaustion and GitHub API rate-limit abuse. Additionally, some suggestions have been provided to improve code style and formatting for better readability and maintainability.

remaining = remaining_api_calls[0]

if int(counter) >= int(500):
if remaining_api_calls == 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

security-high high

The condition if remaining_api_calls == 1: is a critical logic error. remaining_api_calls is a tuple (remaining, limit) from github_instance.rate_limiting, not an integer, so this comparison will always be False. This flaw prevents the loop from breaking, leading to an infinite loop that can cause Out-of-Memory (OOM) crashes, GitHub API rate limit abuse, and redundant processing. The current log message Reached batch size limit of {batch_size} will also be misleading in this context.

            if remaining <= 1:
            print(f"Reached rate limit threshold. Remaining: {remaining}")
            break

command: celery -A worker worker --loglevel=info --concurrency=8
env_file: ./config/.env
deploy:
deploy:
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is a trailing whitespace on this line. It should be removed to maintain clean formatting.

    deploy:

header = [
get_github_data.s(start, batch_size)
for start in range(0, total, batch_size)
get_github_data.s(start, batch_size) for start in range(0, total, batch_size)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While this single-line list comprehension is valid, the previous multi-line version was more readable. For better maintainability and readability, it's often better to keep list comprehensions on multiple lines if they don't fit comfortably on one. I'd suggest reverting to the multi-line format.

        get_github_data.s(start, batch_size)
        for start in range(0, total, batch_size)

return chord(jobs)()

No newline at end of file
# return chord(jobs)()
No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This line contains only whitespace and should be removed. Additionally, the file is missing a newline at the end, which is a common convention and good practice to add.

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.

1 participant