correct brokeness

This commit is contained in:
Sam 2015-02-10 17:05:24 +11:00
parent acda6ebd60
commit 0ce6524153

View File

@ -6,8 +6,7 @@ class Middleware::RequestTracker
@app = app @app = app
end end
def self.log_request_on_site(data) def self.log_request_on_site(data,host)
host = RailsMultisite::ConnectionManagement.host(env)
RailsMultisite::ConnectionManagement.with_hostname(host) do RailsMultisite::ConnectionManagement.with_hostname(host) do
log_request(data) log_request(data)
end end
@ -73,10 +72,11 @@ class Middleware::RequestTracker
# we got to skip this on error ... its just logging # we got to skip this on error ... its just logging
data = self.class.get_data(env,result) rescue nil data = self.class.get_data(env,result) rescue nil
host = RailsMultisite::ConnectionManagement.host(env)
if data if data
Scheduler::Defer.later("Track view", _db=nil) do Scheduler::Defer.later("Track view", _db=nil) do
self.class.log_request_on_site(data) self.class.log_request_on_site(data,host)
end end
end end