From 4bf82f6303465bb74e9e6d2747d3053358ef83b7 Mon Sep 17 00:00:00 2001 From: Daniel Beauchamp Date: Tue, 28 Aug 2012 16:03:22 -0400 Subject: Added in a fix that forces your json codec to initialize before jobs are run. --- lib/dashing.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/dashing.rb b/lib/dashing.rb index beb7eca..7d066cc 100644 --- a/lib/dashing.rb +++ b/lib/dashing.rb @@ -82,7 +82,7 @@ end def send_event(id, body) body["id"] = id body["updatedAt"] = Time.now - event = format_event(JSON.unparse(body)) + event = format_event(body.to_json) settings.history[id] = event settings.connections.each { |out| out << event } end @@ -104,6 +104,7 @@ def first_dashboard end Dir[File.join(settings.root, 'lib', '**', '*.rb')].each {|file| require file } +{}.to_json # Forces your json codec to initialize (in the event that it is lazily loaded). Does this before job threads start. job_path = ENV["JOB_PATH"] || 'jobs' files = Dir[File.join(settings.root, job_path, '/*.rb')] -- cgit v1.2.3