Skip to content

Commit

Permalink
Use defaults with getattr rather than in settings
Browse files Browse the repository at this point in the history
This avoids polluting settings.py with default values that a user will
likely never actually need to tweak.
  • Loading branch information
gherceg committed Aug 16, 2024
1 parent d7b58f5 commit 52d49d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions corehq/motech/repeaters/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
MAX_RETRY_WAIT = timedelta(days=7)
MIN_RETRY_WAIT = timedelta(minutes=60)
RATE_LIMITER_DELAY_RANGE = (
timedelta(minutes=settings.MIN_REPEATER_RATE_LIMIT_DELAY),
timedelta(minutes=settings.MAX_REPEATER_RATE_LIMIT_DELAY),
timedelta(minutes=getattr(settings, 'MIN_REPEATER_RATE_LIMIT_DELAY', 0)),
timedelta(minutes=getattr(settings, 'MAX_REPEATER_RATE_LIMIT_DELAY', 15)),
)
CHECK_REPEATERS_INTERVAL = timedelta(minutes=5)
CHECK_REPEATERS_PARTITION_COUNT = settings.CHECK_REPEATERS_PARTITION_COUNT
Expand Down
3 changes: 0 additions & 3 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,6 @@
# how many tasks to split the check_repeaters process into
CHECK_REPEATERS_PARTITION_COUNT = 1

MIN_REPEATER_RATE_LIMIT_DELAY = 0 # minutes
MAX_REPEATER_RATE_LIMIT_DELAY = 15 # minutes

# If ENABLE_PRELOGIN_SITE is set to true, redirect to Dimagi.com urls
ENABLE_PRELOGIN_SITE = False

Expand Down

0 comments on commit 52d49d8

Please sign in to comment.