From 8270344794b29db9812bf4a3448857e78962fb50 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 10 Aug 2016 11:01:20 +0800 Subject: [PATCH] job --- app/controllers/quality_analysis_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index 53c022fc9..a5c76dcbc 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -32,7 +32,7 @@ class QualityAnalysisController < ApplicationController projects_date = open(@sonar_address + "/api/projects/index").read arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"] quality_an = QualityAnalysis.where(:sonar_name => sonar_name).first - if @client_jenkins.jobdd.exists?(job_name) && QualityAnalysis.where(:sonar_name => sonar_name).select{|qa| arr.include?(qa.sonar_name)}.blank? + if @client_jenkins.job.exists?(job_name) && QualityAnalysis.where(:sonar_name => sonar_name).select{|qa| arr.include?(qa.sonar_name)}.blank? aa = @client_jenkins.job.delete("#{job_name}") quality_an.delete unless quality_an.blank? end