Skip to content

Commit b56e78c

Browse files
author
dmulej
committed
Fix: report_content in to_dict, single worker, hide stale preview
- Add report_content to Research.to_dict() — fixes translate-only cache showing only summary instead of full translated report - Dockerfile: --workers 1 — fixes progress bar dropping to 0% on Fly.io (in-memory progress_tracker not shared between workers) - Hide preview card once analysis starts (no longer stale)
1 parent 530deb9 commit b56e78c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ RUN mkdir -p data/cache
1414

1515
EXPOSE 8080
1616

17-
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8080", "--workers", "2", "--timeout", "120"]
17+
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8080", "--workers", "1", "--timeout", "120"]

src/database/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def to_dict(self):
7171
"executive_summary": self.executive_summary,
7272
"key_findings": self.key_findings,
7373
"detailed_analysis": self.detailed_analysis,
74+
"report_content": self.report_content,
7475
"report_path": self.report_path,
7576
"total_queries": self.total_queries,
7677
"total_sources": self.total_sources,

templates/progress.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,15 @@ <h6 class="mb-0">
222222
lastLogCount = stepsLog.length;
223223
}
224224

225-
// Show preview if available and still in progress
226-
if (preview && status !== 'completed') {
225+
// Show preview during search phase only
226+
var searchSteps = ['queued', 'initializing', 'generating_queries', 'searching'];
227+
if (preview && searchSteps.indexOf(step) !== -1) {
227228
var previewCard = document.getElementById('preview-card');
228229
var previewContent = document.getElementById('preview-content');
229230
previewCard.style.display = '';
230231
previewContent.innerHTML = marked.parse(preview);
232+
} else if (searchSteps.indexOf(step) === -1) {
233+
document.getElementById('preview-card').style.display = 'none';
231234
}
232235

233236
// Handle completion

0 commit comments

Comments
 (0)