lib/rpush/daemon/delivery.rb in rpush-1.0.0-java vs lib/rpush/daemon/delivery.rb in rpush-2.0.0.beta1
- old
+ new
@@ -11,18 +11,28 @@
@batch.mark_retryable(notification, deliver_after)
end
end
def mark_retryable_exponential(notification)
- mark_retryable(notification, Time.now + 2 ** (notification.retries + 1))
+ mark_retryable(notification, Time.now + 2**(notification.retries + 1))
end
def mark_delivered
@batch.mark_delivered(@notification)
end
- def mark_failed(code, description)
- @batch.mark_failed(@notification, code, description)
+ def mark_batch_delivered
+ @batch.mark_all_delivered
+ end
+
+ def mark_failed(error)
+ code = error.respond_to?(:code) ? error.code : nil
+ @batch.mark_failed(@notification, code, error.to_s)
+ end
+
+ def mark_batch_failed(error)
+ code = error.respond_to?(:code) ? error.code : nil
+ @batch.mark_all_failed(code, error.to_s)
end
end
end
end