Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions parallel/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def analyze_code():
if not code:
return Response("No code provided.", status=400, mimetype='text/plain')

# Create a ThreadPoolExecutor to run analyses in parallel
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
# Create partial functions with the code parameter
analysis_functions = [
Expand All @@ -89,15 +88,13 @@ def analyze_code():
"complexity": "Complexity analysis failed"
}

# Collect results as they complete
for future in concurrent.futures.as_completed(future_to_analysis):
analysis_name = future_to_analysis[future]
try:
results[analysis_name] = future.result()
except Exception as e:
results[analysis_name] = f"Error in {analysis_name}: {str(e)}"

# Format the response as HTML
response_html = f"""
<div class="analysis-results">
<div class="execution">
Expand Down