Skip to content
Snippets Groups Projects
Unverified Commit 28577246 authored by J Eskew's avatar J Eskew Committed by GitHub
Browse files

Merge pull request #18260 from edx/revert-18251-jeskew/retry_sailthru_email_deletion

Revert "Retry upon Sailthru optout timeout."
parents 9efeb23f c87ba772
No related merge requests found
......@@ -5,7 +5,6 @@ import datetime
import logging
from random import randint
import backoff
import crum
from celery.exceptions import TimeoutError
from django.conf import settings
......@@ -264,23 +263,7 @@ def _log_sailthru_api_call_time(time_before_call):
delta_sailthru_api_call_time.microseconds / 1000)
def _backoff_handler(details):
"""
Simple logging handler for when timeout backoff occurs.
"""
log.info('Trying again in {wait:0.1f} seconds after {tries} tries calling {target}'.format(**details))
def _not_a_timeout(e):
return 'timed out' not in e.message
@receiver(USER_RETIRE_MAILINGS)
@backoff.on_exception(backoff.expo,
Exception,
max_time=600, # Only 10 minutes of trying
giveup=_not_a_timeout, # Stop trying if exception is *not* a timeout.
on_backoff=_backoff_handler)
def force_unsubscribe_all(sender, **kwargs): # pylint: disable=unused-argument
"""
Synchronously(!) unsubscribes the given user from all Sailthru email lists.
......
......@@ -26,7 +26,6 @@
analytics-python==1.1.0 # Used for Segment analytics
attrs # Reduces boilerplate code involving class attributes
Babel==1.3 # Internationalization utilities, used for date formatting in a few places
backoff
bleach==1.4 # Allowed-list-based HTML sanitizing library that escapes or strips markup and attributes; used for capa and LTI
boto==2.39.0 # Deprecated version of the AWS SDK; we should stop using this
boto3==1.4.8 # Amazon Web Services SDK for Python
......
......@@ -51,7 +51,6 @@ argparse==1.4.0
asn1crypto==0.24.0
attrs==17.4.0
babel==1.3
backoff==1.5.0
beautifulsoup==3.2.1 # via pynliner
billiard==3.3.0.23 # via celery
bleach==1.4
......
......@@ -58,7 +58,6 @@ astroid==1.5.2
atomicwrites==1.1.5
attrs==17.4.0
babel==1.3
backoff==1.5.0
backports.functools-lru-cache==1.5
beautifulsoup4==4.6.0
beautifulsoup==3.2.1
......
......@@ -55,7 +55,6 @@ astroid==1.5.2 # via edx-lint, pylint, pylint-celery, pylint-plugin-u
atomicwrites==1.1.5 # via pytest
attrs==17.4.0
babel==1.3
backoff==1.5.0
backports.functools-lru-cache==1.5 # via astroid, pylint
beautifulsoup4==4.6.0
beautifulsoup==3.2.1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment