Skip to content

Commit

Permalink
feat: enhance GitHub polling with synchronous comment processing and …
Browse files Browse the repository at this point in the history
…improved logging
  • Loading branch information
mrT23 committed Sep 5, 2024
1 parent f0d780c commit 85754d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pr_agent/servers/github_polling.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,17 @@ async def polling_loop():
else:
get_logger().debug(f"Skipping comment processing for PR: {pr_url}")

max_allowed_parallel_tasks = 10
if task_queue:
processes = []
for func, args in task_queue: # Create parallel tasks
for i, func, args in enumerate(task_queue): # Create parallel tasks
p = multiprocessing.Process(target=func, args=args)
processes.append(p)
p.start()
if i > max_allowed_parallel_tasks:
get_logger().error(
f"Dropping {len(task_queue) - max_allowed_parallel_tasks} tasks from polling session")
break
task_queue.clear()

# Dont wait for all processes to complete. Move on to the next iteration
Expand Down

0 comments on commit 85754d2

Please sign in to comment.