Files
baby-nas/internal
darroyo 5b459c0b2e fix(storage): stream job output in real-time with StdoutPipe/StderrPipe
- Replace blocking outBuf/errBuf capture with StdoutPipe+StderrPipe + goroutines
- scanAndEmit runs in parallel for stdout and stderr, emitting each line
  via SSE broadcast and DB append immediately (not after cmd.Run completes)
- Custom scanner split: bytes.TrimRight strips trailing \r so snapraid
  progress lines (e.g. '2%, 57396 MB\r') are stored as clean lines
- scanner.Buffer increased to 128KB max to handle large outputs
- Use sync.WaitGroup to ensure both scanners finish before MarkJobFinished
- Fix PID capture: cmd.Process is nil before cmd.Start(), pass 0 instead
2026-07-07 09:07:08 -04:00
..