mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
configd_ctl.py: catch broken pipe on event handler (#5235)
This commit is contained in:
parent
eb85feceb8
commit
b9de69fe44
@ -125,7 +125,11 @@ if args.e:
|
||||
rlist, _, _ = select([sys.stdin], [], [], args.t)
|
||||
if rlist:
|
||||
last_message_stamp = time.time()
|
||||
stashed_lines.append(sys.stdin.readline())
|
||||
r_line = sys.stdin.readline()
|
||||
if len(r_line) == 0:
|
||||
#EOFError. pipe broken?
|
||||
sys.exit(-1)
|
||||
stashed_lines.append(r_line)
|
||||
|
||||
if len(stashed_lines) >= 1 and (args.t is None or time.time() - last_message_stamp > args.t):
|
||||
# emit event trigger(s) to syslog
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user