This commit is contained in:
Colombo 2020-01-22 17:21:33 +04:00
parent 60804ca3ba
commit 3924ef2bf5
2 changed files with 4 additions and 4 deletions

View file

@ -162,7 +162,7 @@ class Subprocessor(object):
try:
cli = self.SubprocessorCli_class(client_dict)
cli.state = 1
cli.sent_time = time.time()
cli.sent_time = 0
cli.sent_data = None
cli.name = name
cli.host_dict = host_dict
@ -247,7 +247,7 @@ class Subprocessor(object):
for cli in self.clis[:]:
if cli.state == 1:
if self.no_response_time_sec != 0 and (time.time() - cli.sent_time) > self.no_response_time_sec:
if cli.sent_time != and self.no_response_time_sec != 0 and (time.time() - cli.sent_time) > self.no_response_time_sec:
#subprocess busy too long
print ( '%s doesnt response, terminating it.' % (cli.name) )
self.on_data_return (cli.host_dict, cli.sent_data )