{"action":"created","comment":{"url":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/comments/101224614","pull_request_review_id":21944799,"id":101224614,"diff_hunk":"@@ -180,94 +192,138 @@ def run(self, message_id, **kwargs):\n         l.info(\"Loading Outbound Message <%s>\" % message_id)\n         try:\n             message = Outbound.objects.get(id=message_id)\n-            if message.attempts < settings.MESSAGE_SENDER_MAX_RETRIES:\n-                l.info(\"Attempts: %s\" % message.attempts)\n-                # send or resend\n-                try:\n-                    if \"voice_speech_url\" in message.metadata:\n-\n-                        # OBD number of tries metric\n-                        fire_metric.apply_async(kwargs={\n-                            \"metric_name\": 'vumimessage.obd.tries.sum',\n-                            \"metric_value\": 1.0\n-                        })\n-\n-                        # Voice message\n-                        ConcurrencyLimiter.manage_limit(\n-                            self, \"voice\",\n-                            int(getattr(settings,\n-                                        'CONCURRENT_VOICE_LIMIT', 0)),\n-                            int(getattr(settings, 'VOICE_MESSAGE_TIMEOUT', 0)),\n-                            int(getattr(settings, 'VOICE_MESSAGE_DELAY', 0)))\n-                        sender = self.get_voice_client()\n-                        # Start call. We send the voice message on the ack.\n-                        vumiresponse = sender.send_voice(\n-                            voice_to_addr_formatter(message.to_addr),\n-                            None, session_event=\"new\")\n-                        message.call_answered = False\n-                        l.info(\"Sent voice message to <%s>\" % message.to_addr)\n-                    else:\n-                        # Plain content\n-                        ConcurrencyLimiter.manage_limit(\n-                            self, \"text\",\n-                            int(getattr(settings, 'CONCURRENT_TEXT_LIMIT', 0)),\n-                            int(getattr(settings, 'TEXT_MESSAGE_TIMEOUT', 0)),\n-                            int(getattr(settings, 'TEXT_MESSAGE_DELAY', 0)))\n-                        sender = self.get_text_client()\n-                        vumiresponse = sender.send_text(\n-                            text_to_addr_formatter(message.to_addr),\n-                            message.content,\n-                            session_event=\"new\")\n-                        l.info(\"Sent text message to <%s>\" % (\n-                            message.to_addr,))\n-                    message.last_sent_time = datetime.now()\n-                    message.attempts += 1\n-                    message.vumi_message_id = vumiresponse[\"message_id\"]\n-                    message.save()\n+        except ObjectDoesNotExist:\n+            logger.error('Missing Outbound message', exc_info=True)\n+            return\n+\n+        if message.attempts < settings.MESSAGE_SENDER_MAX_RETRIES:\n+            if self.request.retries > 0:\n+                retry_delay = calculate_retry_delay(self.request.retries)\n+            else:\n+                retry_delay = self.default_retry_delay\n+            l.info(\"Attempts: %s\" % message.attempts)\n+            # send or resend\n+            try:\n+                if \"voice_speech_url\" in message.metadata:\n+                    # OBD number of tries metric\n                     fire_metric.apply_async(kwargs={\n-                        \"metric_name\": 'vumimessage.tries.sum',\n+                        \"metric_name\": 'vumimessage.obd.tries.sum',","path":"message_sender/tasks.py","position":126,"original_position":126,"commit_id":"64da3c946685968b8278e52f0a544b3e267ca9f6","original_commit_id":"64da3c946685968b8278e52f0a544b3e267ca9f6","user":{"login":"jpaidoussi","id":3963913,"avatar_url":"https://avatars.githubusercontent.com/u/3963913?v=3","gravatar_id":"","url":"https://api.github.com/users/jpaidoussi","html_url":"https://github.com/jpaidoussi","followers_url":"https://api.github.com/users/jpaidoussi/followers","following_url":"https://api.github.com/users/jpaidoussi/following{/other_user}","gists_url":"https://api.github.com/users/jpaidoussi/gists{/gist_id}","starred_url":"https://api.github.com/users/jpaidoussi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpaidoussi/subscriptions","organizations_url":"https://api.github.com/users/jpaidoussi/orgs","repos_url":"https://api.github.com/users/jpaidoussi/repos","events_url":"https://api.github.com/users/jpaidoussi/events{/privacy}","received_events_url":"https://api.github.com/users/jpaidoussi/received_events","type":"User","site_admin":false},"body":"I think this is a quirk of how the diff is being show. I didn't change the metric names.","created_at":"2017-02-15T08:39:50Z","updated_at":"2017-02-15T08:39:50Z","html_url":"https://github.com/praekelt/seed-message-sender/pull/36#discussion_r101224614","pull_request_url":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/comments/101224614"},"html":{"href":"https://github.com/praekelt/seed-message-sender/pull/36#discussion_r101224614"},"pull_request":{"href":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/36","id":106259203,"html_url":"https://github.com/praekelt/seed-message-sender/pull/36","diff_url":"https://github.com/praekelt/seed-message-sender/pull/36.diff","patch_url":"https://github.com/praekelt/seed-message-sender/pull/36.patch","issue_url":"https://api.github.com/repos/praekelt/seed-message-sender/issues/36","number":36,"state":"open","locked":false,"title":"Feature/seed 1006 add request failure and retries","user":{"login":"jpaidoussi","id":3963913,"avatar_url":"https://avatars.githubusercontent.com/u/3963913?v=3","gravatar_id":"","url":"https://api.github.com/users/jpaidoussi","html_url":"https://github.com/jpaidoussi","followers_url":"https://api.github.com/users/jpaidoussi/followers","following_url":"https://api.github.com/users/jpaidoussi/following{/other_user}","gists_url":"https://api.github.com/users/jpaidoussi/gists{/gist_id}","starred_url":"https://api.github.com/users/jpaidoussi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpaidoussi/subscriptions","organizations_url":"https://api.github.com/users/jpaidoussi/orgs","repos_url":"https://api.github.com/users/jpaidoussi/repos","events_url":"https://api.github.com/users/jpaidoussi/events{/privacy}","received_events_url":"https://api.github.com/users/jpaidoussi/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-02-15T08:00:41Z","updated_at":"2017-02-15T08:39:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ec8d978d75be6a0902790d4858be06ae96a24b0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/36/commits","review_comments_url":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/36/comments","review_comment_url":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/comments{/number}","comments_url":"https://api.github.com/repos/praekelt/seed-message-sender/issues/36/comments","statuses_url":"https://api.github.com/repos/praekelt/seed-message-sender/statuses/64da3c946685968b8278e52f0a544b3e267ca9f6","head":{"label":"praekelt:feature/SEED-1006-add-request-failure-and-retries","ref":"feature/SEED-1006-add-request-failure-and-retries","sha":"64da3c946685968b8278e52f0a544b3e267ca9f6","user":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"repo":{"id":49590883,"name":"seed-message-sender","full_name":"praekelt/seed-message-sender","owner":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekelt/seed-message-sender","description":"Seed Message Sender and Message Store","fork":false,"url":"https://api.github.com/repos/praekelt/seed-message-sender","forks_url":"https://api.github.com/repos/praekelt/seed-message-sender/forks","keys_url":"https://api.github.com/repos/praekelt/seed-message-sender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekelt/seed-message-sender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekelt/seed-message-sender/teams","hooks_url":"https://api.github.com/repos/praekelt/seed-message-sender/hooks","issue_events_url":"https://api.github.com/repos/praekelt/seed-message-sender/issues/events{/number}","events_url":"https://api.github.com/repos/praekelt/seed-message-sender/events","assignees_url":"https://api.github.com/repos/praekelt/seed-message-sender/assignees{/user}","branches_url":"https://api.github.com/repos/praekelt/seed-message-sender/branches{/branch}","tags_url":"https://api.github.com/repos/praekelt/seed-message-sender/tags","blobs_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekelt/seed-message-sender/statuses/{sha}","languages_url":"https://api.github.com/repos/praekelt/seed-message-sender/languages","stargazers_url":"https://api.github.com/repos/praekelt/seed-message-sender/stargazers","contributors_url":"https://api.github.com/repos/praekelt/seed-message-sender/contributors","subscribers_url":"https://api.github.com/repos/praekelt/seed-message-sender/subscribers","subscription_url":"https://api.github.com/repos/praekelt/seed-message-sender/subscription","commits_url":"https://api.github.com/repos/praekelt/seed-message-sender/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekelt/seed-message-sender/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekelt/seed-message-sender/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekelt/seed-message-sender/contents/{+path}","compare_url":"https://api.github.com/repos/praekelt/seed-message-sender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekelt/seed-message-sender/merges","archive_url":"https://api.github.com/repos/praekelt/seed-message-sender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekelt/seed-message-sender/downloads","issues_url":"https://api.github.com/repos/praekelt/seed-message-sender/issues{/number}","pulls_url":"https://api.github.com/repos/praekelt/seed-message-sender/pulls{/number}","milestones_url":"https://api.github.com/repos/praekelt/seed-message-sender/milestones{/number}","notifications_url":"https://api.github.com/repos/praekelt/seed-message-sender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekelt/seed-message-sender/labels{/name}","releases_url":"https://api.github.com/repos/praekelt/seed-message-sender/releases{/id}","deployments_url":"https://api.github.com/repos/praekelt/seed-message-sender/deployments","created_at":"2016-01-13T17:45:56Z","updated_at":"2017-01-03T08:53:18Z","pushed_at":"2017-02-15T08:32:49Z","git_url":"git://github.com/praekelt/seed-message-sender.git","ssh_url":"git@github.com:praekelt/seed-message-sender.git","clone_url":"https://github.com/praekelt/seed-message-sender.git","svn_url":"https://github.com/praekelt/seed-message-sender","homepage":null,"size":152,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":1,"default_branch":"develop"}},"base":{"label":"praekelt:develop","ref":"develop","sha":"c9ad7798d1141ba47c8b4a1f9d61538e1cfe16aa","user":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"repo":{"id":49590883,"name":"seed-message-sender","full_name":"praekelt/seed-message-sender","owner":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekelt/seed-message-sender","description":"Seed Message Sender and Message Store","fork":false,"url":"https://api.github.com/repos/praekelt/seed-message-sender","forks_url":"https://api.github.com/repos/praekelt/seed-message-sender/forks","keys_url":"https://api.github.com/repos/praekelt/seed-message-sender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekelt/seed-message-sender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekelt/seed-message-sender/teams","hooks_url":"https://api.github.com/repos/praekelt/seed-message-sender/hooks","issue_events_url":"https://api.github.com/repos/praekelt/seed-message-sender/issues/events{/number}","events_url":"https://api.github.com/repos/praekelt/seed-message-sender/events","assignees_url":"https://api.github.com/repos/praekelt/seed-message-sender/assignees{/user}","branches_url":"https://api.github.com/repos/praekelt/seed-message-sender/branches{/branch}","tags_url":"https://api.github.com/repos/praekelt/seed-message-sender/tags","blobs_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekelt/seed-message-sender/statuses/{sha}","languages_url":"https://api.github.com/repos/praekelt/seed-message-sender/languages","stargazers_url":"https://api.github.com/repos/praekelt/seed-message-sender/stargazers","contributors_url":"https://api.github.com/repos/praekelt/seed-message-sender/contributors","subscribers_url":"https://api.github.com/repos/praekelt/seed-message-sender/subscribers","subscription_url":"https://api.github.com/repos/praekelt/seed-message-sender/subscription","commits_url":"https://api.github.com/repos/praekelt/seed-message-sender/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekelt/seed-message-sender/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekelt/seed-message-sender/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekelt/seed-message-sender/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekelt/seed-message-sender/contents/{+path}","compare_url":"https://api.github.com/repos/praekelt/seed-message-sender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekelt/seed-message-sender/merges","archive_url":"https://api.github.com/repos/praekelt/seed-message-sender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekelt/seed-message-sender/downloads","issues_url":"https://api.github.com/repos/praekelt/seed-message-sender/issues{/number}","pulls_url":"https://api.github.com/repos/praekelt/seed-message-sender/pulls{/number}","milestones_url":"https://api.github.com/repos/praekelt/seed-message-sender/milestones{/number}","notifications_url":"https://api.github.com/repos/praekelt/seed-message-sender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekelt/seed-message-sender/labels{/name}","releases_url":"https://api.github.com/repos/praekelt/seed-message-sender/releases{/id}","deployments_url":"https://api.github.com/repos/praekelt/seed-message-sender/deployments","created_at":"2016-01-13T17:45:56Z","updated_at":"2017-01-03T08:53:18Z","pushed_at":"2017-02-15T08:32:49Z","git_url":"git://github.com/praekelt/seed-message-sender.git","ssh_url":"git@github.com:praekelt/seed-message-sender.git","clone_url":"https://github.com/praekelt/seed-message-sender.git","svn_url":"https://github.com/praekelt/seed-message-sender","homepage":null,"size":152,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/36"},"html":{"href":"https://github.com/praekelt/seed-message-sender/pull/36"},"issue":{"href":"https://api.github.com/repos/praekelt/seed-message-sender/issues/36"},"comments":{"href":"https://api.github.com/repos/praekelt/seed-message-sender/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/praekelt/seed-message-sender/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/praekelt/seed-message-sender/statuses/64da3c946685968b8278e52f0a544b3e267ca9f6"}}}}
{"actor":{"display_login":"jpaidoussi"}}