seaman: fix the case when no recorders are needed

This commit is contained in:
2025-11-19 14:58:54 +01:00
parent f73f764094
commit d7b21439ed

View File

@@ -265,11 +265,12 @@ class SeaManager(ServiceManager):
args = ' '.join(recorders.get(k, '0') for k in ('main', 'stick', 'addons'))
conn.send(f'seauser seaser\nconfig listen 1\nsea_recorder {args}\n'.encode())
conn.settimeout(2)
prev = b''
while True:
lines = (prev + conn.recv(999)).split(b'\n')
prev = lines.pop()
if b'ACTIVE' in lines:
break
if args != '0 0 0':
prev = b''
while True:
lines = (prev + conn.recv(999)).split(b'\n')
prev = lines.pop()
if b'ACTIVE' in lines:
break
finally:
conn.close()