lib/lifeboat.rb in lifeboat-0.2.2 vs lib/lifeboat.rb in lifeboat-0.2.3

- old
+ new

@@ -62,17 +62,17 @@ def after_initialize @cue = RightAws::SqsGen2.new(Credentials.key, Credentials.secret) end - begin - [:create, :update, :destroy ].each do |action| - define_method(action.to_s + "_lifeboat") do + [:create, :update, :destroy ].each do |action| + define_method(action.to_s + "_lifeboat") do + begin q = RightAws::SqsGen2::Queue.create(@cue, action.to_s+"_"+ self.class.to_s.downcase, true) q.send_message(self.attributes.to_json) + rescue RightAws::AwsError => e + puts "LifeBoat RightAws::AwsError TIMEOUT" + puts e end end - rescue RightAws::AwsError - puts "LifeBoat RightAws::AwsError TIMEOUT" end - end