seaman: fix the case when no recorders are needed
This commit is contained in:
13
seaman.py
13
seaman.py
@@ -265,11 +265,12 @@ class SeaManager(ServiceManager):
|
|||||||
args = ' '.join(recorders.get(k, '0') for k in ('main', 'stick', 'addons'))
|
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.send(f'seauser seaser\nconfig listen 1\nsea_recorder {args}\n'.encode())
|
||||||
conn.settimeout(2)
|
conn.settimeout(2)
|
||||||
prev = b''
|
if args != '0 0 0':
|
||||||
while True:
|
prev = b''
|
||||||
lines = (prev + conn.recv(999)).split(b'\n')
|
while True:
|
||||||
prev = lines.pop()
|
lines = (prev + conn.recv(999)).split(b'\n')
|
||||||
if b'ACTIVE' in lines:
|
prev = lines.pop()
|
||||||
break
|
if b'ACTIVE' in lines:
|
||||||
|
break
|
||||||
finally:
|
finally:
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user