summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2013-03-26 13:27:58 -0400
committerpushmatrix <daniel.beauchamp@gmail.com>2013-04-03 14:20:33 +0200
commit98f326eab33ee741c2d95c1861fc5c9233f0b47d (patch)
tree9ee01e504e9018d037eb540121a170152a25c8e0 /lib
parentc9f2eab6a7fa52c7fb580968e44da091926e5ce9 (diff)
Send an X-Accel-Redirect in /events to disable nginx buffering.
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 bae4c29..949cfee 100644
--- a/lib/dashing.rb
+++ b/lib/dashing.rb
@@ -32,6 +32,7 @@ end
get '/events', provides: 'text/event-stream' do
protected!
+ response.headers['X-Accel-Buffering'] = 'no' # Disable buffering for nginx
stream :keep_open do |out|
settings.connections << out
out << latest_events
@@ -116,4 +117,4 @@ Dir[File.join(settings.root, 'lib', '**', '*.rb')].each {|file| require file }
job_path = ENV["JOB_PATH"] || 'jobs'
files = Dir[File.join(settings.root, job_path, '/*.rb')]
-files.each { |job| require(job) }
+files.each { |job| require(job) }