uncommend popen
This commit is contained in:
parent
ac9a57c4a4
commit
89cfcb6a5f
|
@ -17,7 +17,7 @@ class PullRequestsController < ApplicationController
|
|||
require 'json'
|
||||
require 'open-uri'
|
||||
require 'uri'
|
||||
# require 'string.io' # add by zxh: 将控制台shell命令输出到指定位置
|
||||
require 'stringio' # add by zxh: 将控制台shell命令输出到指定位置
|
||||
|
||||
# 返回json格式
|
||||
def index
|
||||
|
@ -335,18 +335,18 @@ class PullRequestsController < ApplicationController
|
|||
pushTXInfo["shas"] = shas # 后续修改为shaList
|
||||
pushTXInfoJson = pushTXInfo.to_json
|
||||
# 发送交易
|
||||
# Rails.logger.info("before executing chain_trustie command...")
|
||||
# cmd = "chain_trustie pushPRTX " + pushTXInfoJson
|
||||
# # result = system # 执行失败了
|
||||
# output = StringIO.new
|
||||
# IO.popen(cmd) do |pipe|
|
||||
# pipe.each do |line|
|
||||
# Rails.logger.info(line)
|
||||
# end
|
||||
# end
|
||||
# Rails.logger.info(output.string)
|
||||
# # Rails.logger.info(result)
|
||||
# Rails.logger.info("after executing chain_trustie command...")
|
||||
Rails.logger.info("before executing chain_trustie command...")
|
||||
cmd = "chain_trustie pushPRTX " + pushTXInfoJson
|
||||
# result = system # 执行失败了
|
||||
output = StringIO.new
|
||||
IO.popen(cmd) do |pipe|
|
||||
pipe.each do |line|
|
||||
Rails.logger.info(line)
|
||||
end
|
||||
end
|
||||
Rails.logger.info(output.string)
|
||||
# Rails.logger.info(result)
|
||||
Rails.logger.info("after executing chain_trustie command...")
|
||||
# add by zxh end
|
||||
|
||||
respond_to do |format|
|
||||
|
|
Loading…
Reference in New Issue