lib/stackify/authorization/authorization_client.rb in stackify-api-ruby-1.2.3 vs lib/stackify/authorization/authorization_client.rb in stackify-api-ruby-1.2.4
- old
+ new
@@ -12,19 +12,23 @@
task = auth_task attempts
@worker.perform delay_time, task
end
def auth_task attempts
- properties = {
- limit: 1,
- attempts: attempts,
- success_condition: lambda do |result|
- result.try(:status) == 200
+ begin
+ properties = {
+ limit: 1,
+ attempts: attempts,
+ success_condition: lambda do |result|
+ result.try(:status) == 200
+ end
+ }
+ Stackify::ScheduleTask.new properties do
+ Stackify.internal_log :debug, '[AuthorizationClient] trying to authorize...'
+ send_request BASE_URI, Stackify::EnvDetails.instance.auth_info.to_json
end
- }
- Stackify::ScheduleTask.new properties do
- Stackify.internal_log :debug, '[AuthorizationClient] trying to authorize...'
- send_request BASE_URI, Stackify::EnvDetails.instance.auth_info.to_json
+ rescue => exception
+ Stackify.log_internal_error "[AuthorizationClient]: An error occured in auth_task!"
end
end
end
end