summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Beauchamp <daniel.beauchamp@shopify.com>2012-08-28 16:03:22 -0400
committerDaniel Beauchamp <daniel.beauchamp@shopify.com>2012-08-28 16:07:53 -0400
commit4bf82f6303465bb74e9e6d2747d3053358ef83b7 (patch)
tree7d66dc1cf365bf896c5c7da1157eeca9a36f7ea6 /lib
parenta4f10ed0084f2eb3801a64fc8ea8e8fea8e2540d (diff)
Added in a fix that forces your json codec to initialize before jobs are run.
Diffstat (limited to 'lib')
-rw-r--r--lib/dashing.rb3
1 files changed, 2 insertions, 1 deletions
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')]