-
Notifications
You must be signed in to change notification settings - Fork 0
added concurrency to celery in docker_compose.yml #24
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,7 +129,7 @@ def get_github_data(self, start_in_repo_num: int = 0, batch_size: int = 500, git | |
| remaining_api_calls = github_instance.rate_limiting | ||
| remaining = remaining_api_calls[0] | ||
|
|
||
| if int(counter) >= int(500): | ||
| if remaining_api_calls == 1: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The condition if remaining <= 1:
print(f"Reached rate limit threshold. Remaining: {remaining}")
break |
||
| print(f"Reached batch size limit of {batch_size}") | ||
|
|
||
| break | ||
|
|
@@ -178,21 +178,19 @@ def aggregate_results(results): | |
|
|
||
| def build_repo_chord(total: int = 5000, batch_size: int = 500): | ||
| 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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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(header)(aggregate_results.s()) | ||
|
|
||
|
|
||
|
|
||
| # old code that did not work | ||
| @app.task | ||
| def distribute_tasks(): | ||
| # @app.task | ||
| # def distribute_tasks(): | ||
|
|
||
| jobs = group([ | ||
| get_github_data.s(start, 500) | ||
| for start in range(0, 5000, 500) | ||
| ]) | ||
| # jobs = group([ | ||
| # get_github_data.s(start, 500) | ||
| # for start in range(0, 5000, 500) | ||
| # ]) | ||
|
|
||
| return chord(jobs)() | ||
|
|
||
| # return chord(jobs)() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
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.
There is a trailing whitespace on this line. It should be removed to maintain clean formatting.
deploy: