made a pubsubhub constant
This commit is contained in:
parent
4160baa25e
commit
99f7e938fd
3 changed files with 7 additions and 5 deletions
|
|
@ -1,11 +1,14 @@
|
|||
development:
|
||||
debug: false
|
||||
socket_port: 8080
|
||||
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
||||
|
||||
test:
|
||||
debug: false
|
||||
socket_port: 8081
|
||||
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
||||
|
||||
production:
|
||||
debug: false
|
||||
socket_port: 8080
|
||||
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ module Diaspora
|
|||
|
||||
def push_to(recipients)
|
||||
|
||||
@@queue.add_hub_notification('http://pubsubhubbub.appspot.com/', User.owner.url + self.class.to_s.pluralize.underscore + '.atom')
|
||||
@@queue.add_hub_notification(APP_CONFIG[:pubsub_server], User.owner.url + self.class.to_s.pluralize.underscore + '.atom')
|
||||
|
||||
unless recipients.empty?
|
||||
recipients.map!{|x| x = x.url + "receive/"}
|
||||
|
|
@ -132,7 +132,7 @@ module Diaspora
|
|||
|
||||
def self.endpoints
|
||||
<<-XML
|
||||
<link href="http://pubsubhubbub.appspot.com/" rel="hub"/>
|
||||
<link href="#{APP_CONFIG[:pubsub_server]}" rel="hub"/>
|
||||
XML
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ class MessageHandler
|
|||
|
||||
NUM_TRIES = 3
|
||||
TIMEOUT = 5 #seconds
|
||||
|
||||
|
||||
def initialize
|
||||
@queue = EM::Queue.new
|
||||
end
|
||||
|
|
@ -18,7 +18,6 @@ class MessageHandler
|
|||
end
|
||||
|
||||
def add_hub_notification(destination, feed_location)
|
||||
puts "going to: #{destination}, telling it to fetch #{feed_location}"
|
||||
@queue.push(Message.new(:pubhub, destination, feed_location))
|
||||
end
|
||||
|
||||
|
|
@ -33,7 +32,7 @@ class MessageHandler
|
|||
http.callback {send_to_seed(query, http.response); process}
|
||||
when :pubhub
|
||||
http = EventMachine::PubSubHubbub.new(query.destination).publish query.body, :timeout => TIMEOUT
|
||||
http.callback { puts "boner city"; process}
|
||||
http.callback { process}
|
||||
else
|
||||
raise "message is not a type I know!"
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue