diff --git a/README.md b/README.md index 2d3182d..6f7b50f 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,14 @@ f = RestFirebase.new :site => 'https://SampleChat.firebaseIO-demo.com/', :secret => 'secret', :d => {:auth_data => 'something'}, :log_method => method(:puts), + # `timeout` in seconds + :timeout => 10, + # `max_retries` upon failures + :max_retries => 3, + # `retry_exceptions` for which exceptions should retry + # Default is: `[IOError, SystemCallError]` + :retry_exceptions => + [IOError, SystemCallError, Timeout::Error], # `auth_ttl` describes when we should refresh the auth # token. Set it to `false` to disable auto-refreshing. # The default is 23 hours. diff --git a/lib/rest-firebase.rb b/lib/rest-firebase.rb index 50b74ad..3b5bc49 100644 --- a/lib/rest-firebase.rb +++ b/lib/rest-firebase.rb @@ -5,19 +5,19 @@ # https://www.firebase.com/docs/rest-api.html # https://www.firebase.com/docs/rest/guide/retrieving-data.html#section-rest-queries RestFirebase = RC::Builder.client(:d, :secret, :auth, :auth_ttl, :iat) do - use RC::Timeout , 10 - use RC::DefaultSite , 'https://SampleChat.firebaseIO-demo.com/' use RC::DefaultHeaders, {'Accept' => 'application/json', 'Content-Type' => 'application/json'} use RC::DefaultQuery , nil + use RC::Retry , 0, RC::Retry::DefaultRetryExceptions + use RC::Timeout , 10 use RC::FollowRedirect, 1 - use RC::CommonLogger , nil use RC::ErrorHandler , lambda{ |env| RestFirebase::Error.call(env) } use RC::ErrorDetectorHttp use RC::JsonRequest , true use RC::JsonResponse , true + use RC::CommonLogger , nil use RC::Cache , nil, 600 end diff --git a/rest-core b/rest-core index b58a67e..225b14b 160000 --- a/rest-core +++ b/rest-core @@ -1 +1 @@ -Subproject commit b58a67ec245b5f565b43ff5c7f93f68eaa421f7a +Subproject commit 225b14b8a0a84bf9757735df3b8ec6b2eeaba120