mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Fix race condition: set _running before starting reader thread
The reader thread loop checks self._running but it was being set to True after _start_satdump() returned, which is after the thread already started. The thread would see _running=False and exit immediately without reading any SatDump output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -252,8 +252,8 @@ class WeatherSatDecoder:
|
||||
self._capture_phase = 'tuning'
|
||||
|
||||
try:
|
||||
self._start_satdump(sat_info, device_index, gain, sample_rate, bias_t)
|
||||
self._running = True
|
||||
self._start_satdump(sat_info, device_index, gain, sample_rate, bias_t)
|
||||
|
||||
logger.info(
|
||||
f"Weather satellite capture started: {satellite} "
|
||||
@@ -272,6 +272,7 @@ class WeatherSatDecoder:
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
self._running = False
|
||||
logger.error(f"Failed to start weather satellite capture: {e}")
|
||||
self._emit_progress(CaptureProgress(
|
||||
status='error',
|
||||
|
||||
Reference in New Issue
Block a user