HTTP Status re-fix take 4

James Peret %!s(int64=8) %!d(string=hace) años
padre
commit
6a5e5390df
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      app/models/agents/http_status_agent.rb

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

@@ -83,7 +83,7 @@ module Agents
83 83
       payload = { 'url' => url, 'response_received' => false, 'elapsed_time' => total_time }
84 84
 
85 85
       # Deal with failures
86
-      if measured_result.status != 0
86
+      if current_status != 0
87 87
         final_url = boolify(options['disable_redirect_follow']) ? url : measured_result.to_hash[:url]
88 88
         payload.merge!({ 'final_url' => final_url, 'redirected' => (url != final_url), 'response_received' => true, 'status' => current_status })
89 89
         # Deal with headers
@@ -97,7 +97,7 @@ module Agents
97 97
         memory['last_status'] = measured_result.status.to_s
98 98
       else
99 99
         create_event payload: payload
100
-        memory['last_status'] = nil
100
+        memory['last_status'] = 0
101 101
       end
102 102
 
103 103
     end