Skip to content

Commit

Permalink
Move sms providers balance back to the middle more frequently
Browse files Browse the repository at this point in the history
We used to only do it every one hour - let's go down to every
15 minutes, to balance with shorter intervals for taking traffic
away on slow delivery.
  • Loading branch information
CrystalPea committed Dec 6, 2024
1 parent 6d0d50e commit 029a8bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/dao/provider_details_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def dao_adjust_provider_priority_back_to_resting_points():
each towards their defined resting points (set in SMS_PROVIDER_RESTING_POINTS in config.py).
"""
amount_to_reduce_by = 10
time_threshold = timedelta(hours=1)
time_threshold = timedelta(minutes=15)

providers = _get_sms_providers_for_update(time_threshold)

Expand Down
2 changes: 1 addition & 1 deletion tests/app/dao/test_provider_details_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def test_adjust_provider_priority_back_to_resting_points_updates_all_providers(

dao_adjust_provider_priority_back_to_resting_points()

mock_get_providers.assert_called_once_with(timedelta(hours=1))
mock_get_providers.assert_called_once_with(timedelta(minutes=15))
mock_adjust.assert_any_call(mmg, new_mmg)
mock_adjust.assert_any_call(firetext, new_firetext)

Expand Down

0 comments on commit 029a8bf

Please sign in to comment.