Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix broken unit tests

  • Loading branch information...
commit 07477efacf0bccbcf3654681f547b6c7370920d7 1 parent cd70ea0
@JimGochee JimGochee authored
View
4 lib/newrelic/agent/agent.rb
@@ -652,7 +652,7 @@ def invoke_remote(method, *args)
# send the given message to STDERR as well as the agent log, so that it shows
# up in the console. This should be used for important informational messages at boot
def log!(msg, level = :info)
- to_stderr "[#{Time.now.strftime("%m/%d/%y %H:%M:%S")} (#{$$})] #{level} : #{msg}\n"
+ to_stderr msg
log.send level, msg if log
end
@@ -665,7 +665,7 @@ def to_stderr(msg)
end
def graceful_disconnect
- if @connected # && remote_host != "localhost"
+ if @connected && !(remote_host == "localhost" && @port == 3000)
begin
log.info "Sending graceful shutdown message to #{remote_host}:#{remote_port}"
View
8 lib/newrelic/agent/worker_loop.rb
@@ -65,10 +65,14 @@ def run_next_task
# sleep until this next task's scheduled invocation time
sleep_time = task.next_invocation_time - Time.now
- sleep_time.to_i.times do
- sleep 1
+ # sleep in chunks no longer than 1 second
+ while sleep_time > 0
+ sleep (sleep_time > 1 ? 1 : sleep_time)
+
return if !@should_run
+
+ sleep_time -= 1
end
begin
Please sign in to comment.
Something went wrong with that request. Please try again.