Skip to content

Instantly share code, notes, and snippets.

@boucher
Created February 12, 2012 21:19
Show Gist options
  • Select an option

  • Save boucher/1810894 to your computer and use it in GitHub Desktop.

Select an option

Save boucher/1810894 to your computer and use it in GitHub Desktop.
diff --git a/notify/notify-srv.rb b/notify/notify-srv.rb
index 51b56b2..0cd942a 100755
--- a/notify/notify-srv.rb
+++ b/notify/notify-srv.rb
@@ -264,16 +264,15 @@ class Sweeper
PushNotification.load_all(:started => nil, :completed => nil) do |p|
Opus::DaemonCommon.exit_if_necessary
+ # Don't try more failed URLs in this run. This way if a host
+ # is down we don't try a ton of webhooks for it to the
+ # exclusion of others
+ next if failed_urls.include?(p.url)
+
# We only get a PushNotification level lock here with the assumption that no one
# modifies PushNotifications and it would be terrible to be getting this many Merchant locks
PushNotification.update(p.token) do
push_notification = PushNotification.load(p.token)
-
- # Don't try more failed URLs in this run. This way if a host
- # is down we don't try a ton of webhooks for it to the
- # exclusion of others
- next if failed_urls.include?(p.url)
-
push_notification.started = Time.stamp
if push_notification.livemode.nil?
if ctok = push_notification.params['customer']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment