Skip to content
Extraits de code Groupes Projets
Valider 018d516b rédigé par danielgrippi's avatar danielgrippi
Parcourir les fichiers

rescue pubsubhubbub error if your pod is offline (resolves issue when posting...

rescue pubsubhubbub error if your pod is offline (resolves issue when posting public posts in dev mode with no internet connectivity)
parent 5bbfebdb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -8,15 +8,16 @@ class Pubsubhubbub ...@@ -8,15 +8,16 @@ class Pubsubhubbub
def initialize(hub, options={}) def initialize(hub, options={})
@headers = H.merge(options[:head]) if options[:head] @headers = H.merge(options[:head]) if options[:head]
@hub = hub @hub = hub
end end
def publish(feed) def publish(feed)
begin begin
response = RestClient.post(@hub, :headers => @headers, 'hub.url' => feed, 'hub.mode' => 'publish') return RestClient.post(@hub, :headers => @headers, 'hub.url' => feed, 'hub.mode' => 'publish')
return response rescue RestClient::BadRequest=> e
rescue RestClient::BadRequest=> e Rails.logger.warn "Public URL for your users are incorrect. (This is ok if you are in development and localhost is your pod_url) #{e.inspect}"
Rails.logger.warn "Public URL for your users are incorrect. this is ok if you are in development and localhost is your pod_url#{e.inspect}" rescue SocketError
Rails.logger.warn "Pod not connected to the internet. Cannot post to pubsub hub!"
end end
end end
end end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter