Fix unexpected blocking in Remote::execute:
Wait for inactivity on the specific channel we open for the execution instead of looping the global session.
This commit is contained in:
parent
b92dfcc9b7
commit
400fa1ee3f
@ -25,7 +25,7 @@ module Producer
|
|||||||
|
|
||||||
def execute(command)
|
def execute(command)
|
||||||
output = ''
|
output = ''
|
||||||
session.open_channel do |channel|
|
channel = session.open_channel do |channel|
|
||||||
channel.exec command do |ch, success|
|
channel.exec command do |ch, success|
|
||||||
ch.on_data do |c, data|
|
ch.on_data do |c, data|
|
||||||
output << data
|
output << data
|
||||||
@ -37,7 +37,7 @@ module Producer
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
session.loop
|
channel.wait
|
||||||
output
|
output
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user