diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index ebb6e13f1..6a3266b8e 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -62,7 +62,15 @@ class GamesController < ApplicationController params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :step => "#{step}", :gitUrl => "#{gitUrl}", :input => input, :output => output } uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob") res = uri_exec uri, params - @game.update_attribute(:status, 1) + # @game.update_attribute(:status, 1) + for i in 0..30 do + sleep(2) + new_game = Game.where(:id => @game.id).first + logger.info("#####################{new_game.status}") + if new_game.status == 2 + break + end + end @outputs = @game.outputs end respond_to do |format|