|
@@ -168,9 +168,8 @@ flowchart TD
|
|
|
|
|
|
|
|
T --> Y{Process Complete?}
|
|
T --> Y{Process Complete?}
|
|
|
Y -->|No| T
|
|
Y -->|No| T
|
|
|
- Y -->|Yes| Z[Update Task Status: completed/failed]
|
|
|
|
|
- Z --> AA[Update File Status]
|
|
|
|
|
- AA --> BB[EventsGateway: emit Completion Events]
|
|
|
|
|
|
|
+ Y -->|Yes| Z[Update Task: completed/failed]
|
|
|
|
|
+ Z --> BB[EventsGateway: emit Completion Events]
|
|
|
BB --> CC[UI Shows Final Status]
|
|
BB --> CC[UI Shows Final Status]
|
|
|
|
|
|
|
|
DD[User Manual Requeue] --> EE[HTTP POST to Controller]
|
|
DD[User Manual Requeue] --> EE[HTTP POST to Controller]
|
|
@@ -241,10 +240,8 @@ flowchart TD
|
|
|
M --> N{Exit Code 0?}
|
|
M --> N{Exit Code 0?}
|
|
|
N -->|Yes| O[Update Task: completed]
|
|
N -->|Yes| O[Update Task: completed]
|
|
|
N -->|No| P[Update Task: failed]
|
|
N -->|No| P[Update Task: failed]
|
|
|
- O --> Q[Update File Status: success]
|
|
|
|
|
- P --> R[Update File Status: error]
|
|
|
|
|
- Q --> S[emit Completion Events]
|
|
|
|
|
- R --> S
|
|
|
|
|
|
|
+ O --> S[emit Completion Events]
|
|
|
|
|
+ P --> S
|
|
|
S --> D
|
|
S --> D
|
|
|
|
|
|
|
|
T[Manual Requeue] --> U[createTask() High Priority]
|
|
T[Manual Requeue] --> U[createTask() High Priority]
|
|
@@ -265,6 +262,7 @@ The TaskQueueService supports configurable processing parameters that control ho
|
|
|
- **Processing Interval** (`processingInterval`): How often to check for new tasks in milliseconds (default: 5 seconds)
|
|
- **Processing Interval** (`processingInterval`): How often to check for new tasks in milliseconds (default: 5 seconds)
|
|
|
|
|
|
|
|
**Queue Processing Behavior:**
|
|
**Queue Processing Behavior:**
|
|
|
|
|
+
|
|
|
- In each processing cycle, up to `batchSize` pending tasks are retrieved from the database
|
|
- In each processing cycle, up to `batchSize` pending tasks are retrieved from the database
|
|
|
- Tasks are started for processing only if the number of currently active tasks is below `concurrency`
|
|
- Tasks are started for processing only if the number of currently active tasks is below `concurrency`
|
|
|
- If `batchSize = 3` and `concurrency = 1`, the system will pull 3 tasks but only process 1 at a time
|
|
- If `batchSize = 3` and `concurrency = 1`, the system will pull 3 tasks but only process 1 at a time
|
|
@@ -389,11 +387,7 @@ erDiagram
|
|
|
string dataset
|
|
string dataset
|
|
|
string input
|
|
string input
|
|
|
string output
|
|
string output
|
|
|
- string status
|
|
|
|
|
string date
|
|
string date
|
|
|
- string preset
|
|
|
|
|
- integer progress
|
|
|
|
|
- string error_message
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
|
tasks {
|
|
@@ -424,7 +418,7 @@ erDiagram
|
|
|
|
|
|
|
|
- `GET /files` - List enabled datasets
|
|
- `GET /files` - List enabled datasets
|
|
|
- `GET /files/all-datasets` - List all datasets
|
|
- `GET /files/all-datasets` - List all datasets
|
|
|
-- `GET /files/:dataset/status/:status` - Get files by status
|
|
|
|
|
|
|
+- `GET /files/:dataset` - Get all files for a dataset
|
|
|
- `POST /files/:dataset/:file/requeue` - Requeue file for processing
|
|
- `POST /files/:dataset/:file/requeue` - Requeue file for processing
|
|
|
- `DELETE /files/:dataset/:file` - Delete file record
|
|
- `DELETE /files/:dataset/:file` - Delete file record
|
|
|
|
|
|
|
@@ -602,4 +596,53 @@ flowchart TD
|
|
|
N --> Q[WebSocket Status]
|
|
N --> Q[WebSocket Status]
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
+## Recent Improvements & Optimizations
|
|
|
|
|
+
|
|
|
|
|
+### Database Schema Simplification (January 2026)
|
|
|
|
|
+
|
|
|
|
|
+The `files` table schema was simplified by removing the `status` column:
|
|
|
|
|
+
|
|
|
|
|
+- **Before**: Files had status tracking (`discovered`, `success`, `error`) causing complexity in queries
|
|
|
|
|
+- **After**: Files table is now a simple observation log with just `dataset`, `input`, `output`, and `date`
|
|
|
|
|
+- **Benefit**: Eliminates confusion between file observations and task processing states
|
|
|
|
|
+- **Migration**: Existing databases automatically migrated while preserving all file records
|
|
|
|
|
+
|
|
|
|
|
+### UI/UX Enhancements (January 2026)
|
|
|
|
|
+
|
|
|
|
|
+**localStorage Persistence**:
|
|
|
|
|
+
|
|
|
|
|
+- Filter selections (datasets, statuses) persist across page reloads
|
|
|
|
|
+- Search terms maintained between sessions
|
|
|
|
|
+- Sort preferences saved per-page
|
|
|
|
|
+- Page size preferences remembered
|
|
|
|
|
+- Namespaced keys prevent conflicts: `fileList:*`, `taskList:*`
|
|
|
|
|
+
|
|
|
|
|
+**Loading State Improvements**:
|
|
|
|
|
+
|
|
|
|
|
+- Fixed "flash of empty content" on fresh page loads
|
|
|
|
|
+- Proper loading indicators during data fetching
|
|
|
|
|
+- Handles multi-step query dependencies (datasets → files)
|
|
|
|
|
+- Shows spinner until data is fully loaded, preventing wrong impression
|
|
|
|
|
+
|
|
|
|
|
+**Real-time Progress Tracking**:
|
|
|
|
|
+
|
|
|
|
|
+- HandBrake progress regex updated to handle space before `%` sign
|
|
|
|
|
+- Format: `"Encoding: task 1 of 1, 79.60 %"` now correctly parsed
|
|
|
|
|
+- React Query cache updates for smooth progress transitions
|
|
|
|
|
+- Visual progress bar with color-coded states
|
|
|
|
|
+- WebSocket events processed efficiently without full refetches
|
|
|
|
|
+
|
|
|
|
|
+**Code Quality**:
|
|
|
|
|
+
|
|
|
|
|
+- Fixed React key warnings in list rendering
|
|
|
|
|
+- Proper React.Fragment usage with keys in mapped components
|
|
|
|
|
+- Improved error boundary handling
|
|
|
|
|
+
|
|
|
|
|
+### Performance Optimizations
|
|
|
|
|
+
|
|
|
|
|
+- **Efficient Cache Updates**: Progress events update React Query cache directly instead of triggering full refetches
|
|
|
|
|
+- **Reduced API Calls**: localStorage caching reduces redundant settings requests
|
|
|
|
|
+- **Optimistic UI Updates**: Immediate feedback for user actions with background sync
|
|
|
|
|
+- **Proper Loading States**: Prevents unnecessary re-renders and empty state flashing
|
|
|
|
|
+
|
|
|
This documentation provides a comprehensive overview of the Watch Finished Turbo system architecture, data flows, and operational procedures. The Mermaid.js diagrams illustrate the complex interactions between components, while the detailed explanations help developers understand how to work with and extend the system.
|
|
This documentation provides a comprehensive overview of the Watch Finished Turbo system architecture, data flows, and operational procedures. The Mermaid.js diagrams illustrate the complex interactions between components, while the detailed explanations help developers understand how to work with and extend the system.
|