0
我有一個編譯按鈕,在我的Rails應用程序,它確實防止在掛ssh的時候掛軌?
get_pdf_cmd = ['ssh', '-i', '~/.ssh/id_rsa', '-o', 'StrictHostKeyChecking=no', '[email protected]', '/bin/bash', '--login', '/compile.sh', container['host'] ]
Rails.logger.info(get_pdf_cmd)
stdin, stdout_and_stderr, wait_thr = Open3.popen2e({}, get_pdf_cmd.join(" "))
Rails.logger.info stdout_and_stderr.gets(nil)
stdout_and_stderr.close
stdin.close
exit_code = wait_thr.value
,雖然這種情況發生的整個Rails應用程序掛起並且不響應。
問題的SSH命令運行時
我怎樣才能防止滑軌從掛?
在ActiveJob中執行它嗎? –