HTTP Status re-fix take 3

James Peret 8 年之前
父节点
当前提交
f8330af59b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/models/agents/http_status_agent.rb

+ 1 - 1
app/models/agents/http_status_agent.rb

@@ -77,7 +77,7 @@ module Agents
77 77
       measured_result = ping(url)
78 78
       total_time = Time.now.to_f - start
79 79
 
80
-      current_status = measured_result.status.to_s
80
+      current_status = measured_result ? measured_result.status.to_s : 0
81 81
       return if options['changes_only'] == 'true' && current_status == memory['last_status'].to_s
82 82
 
83 83
       payload = { 'url' => url, 'response_received' => false, 'elapsed_time' => total_time }