Skip to content

Commit 98f326e

Browse files
byrootpushmatrix
authored andcommitted
Send an X-Accel-Redirect in /events to disable nginx buffering.
1 parent c9f2eab commit 98f326e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/dashing.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def protected!
3232

3333
get '/events', provides: 'text/event-stream' do
3434
protected!
35+
response.headers['X-Accel-Buffering'] = 'no' # Disable buffering for nginx
3536
stream :keep_open do |out|
3637
settings.connections << out
3738
out << latest_events
@@ -116,4 +117,4 @@ def first_dashboard
116117

117118
job_path = ENV["JOB_PATH"] || 'jobs'
118119
files = Dir[File.join(settings.root, job_path, '/*.rb')]
119-
files.each { |job| require(job) }
120+
files.each { |job| require(job) }

0 commit comments

Comments
 (0)