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)
|
||||
output = ''
|
||||
session.open_channel do |channel|
|
||||
channel = session.open_channel do |channel|
|
||||
channel.exec command do |ch, success|
|
||||
ch.on_data do |c, data|
|
||||
output << data
|
||||
@ -37,7 +37,7 @@ module Producer
|
||||
end
|
||||
end
|
||||
end
|
||||
session.loop
|
||||
channel.wait
|
||||
output
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user