summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dashing.rb2
-rw-r--r--lib/dashing/app.rb11
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/dashing.rb b/lib/dashing.rb
index 855aa36..3527034 100644
--- a/lib/dashing.rb
+++ b/lib/dashing.rb
@@ -3,4 +3,4 @@ require 'dashing/downloader'
require 'dashing/app'
module Dashing
-end
+end \ No newline at end of file
diff --git a/lib/dashing/app.rb b/lib/dashing/app.rb
index 033849c..921bf9c 100644
--- a/lib/dashing/app.rb
+++ b/lib/dashing/app.rb
@@ -6,6 +6,7 @@ require 'coffee-script'
require 'sass'
require 'json'
require 'yaml'
+require 'thin'
SCHEDULER = Rufus::Scheduler.new
@@ -119,6 +120,16 @@ get '/views/:widget?.html' do
end
end
+Thin::Server.class_eval do
+ def stop_with_connection_closing
+ Sinatra::Application.settings.connections.dup.each(&:close)
+ stop_without_connection_closing
+ end
+
+ alias_method :stop_without_connection_closing, :stop
+ alias_method :stop, :stop_with_connection_closing
+end
+
def send_event(id, body, target=nil)
body[:id] = id
body[:updatedAt] ||= Time.now.to_i