Skip to content

Commit

Permalink
Moving event queue initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
afcapel committed Aug 27, 2011
1 parent a0fa24f commit f73efdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions lib/alondra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class Alondra < Rails::Engine

Server.die_gracefully_on_signal
end

initializer "start event queue" do
EventQueue.push({}) # start push socket as soon as possible
end
end
end

Expand Down
5 changes: 1 addition & 4 deletions lib/alondra/event_queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ def self.push(event)

def initialize
Rails.logger.debug "Starting event queue"

send({}) # start push socket as soon as possible

start if ENV['ALONDRA_SERVER'].present?
end

Expand Down Expand Up @@ -44,7 +41,7 @@ def parse(received_string)
elsif received_hash[:message]
message = Message.new(received_hash[:content])
else
Rails.logger.error "Not recognized message type #{received.copy_out_string}"
Rails.logger.warn "Not recognized message type #{received_string}"
end
end

Expand Down

0 comments on commit f73efdf

Please sign in to comment.