Commit b9223ed
committed
docs(batch): document BatchTranslationService re-initialization investigation (Issue #13)
Investigated potential re-initialization issue in BatchTranslationService.
Findings:
- Analyzed pLimit instance creation on every translateFiles() call
- Confirmed current implementation is CORRECT and follows best practices
- Creating new pLimit per batch provides necessary isolation
- Prevents queue mixing between different batch operations
- Service is stateless with no persistent state between calls
- All 39 batch translation tests pass
Conclusion:
- No code changes needed
- Current implementation is correct
- Issue was either already fixed or false positive from original review
- Each batch operation correctly gets its own pLimit queue
Technical Details:
- pLimit created at line 81 in translateFiles()
- Intentional design for isolation, not a bug
- No mutable state persists between calls
- Concurrency setting properly validated in constructor (1-100)
Location: src/services/batch-translation.ts:811 parent 009e628 commit b9223ed
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
113 | 125 | | |
114 | 126 | | |
115 | 127 | | |
| |||
0 commit comments