Skip to content

Commit

Permalink
Limit max number of lazy refresh user ids (#1730)
Browse files Browse the repository at this point in the history
Co-authored-by: Saliou Diallo <saliou@audius.co>
  • Loading branch information
sddioulde and Saliou Diallo committed Aug 5, 2021
1 parent 5f5e27b commit 2108346
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion discovery-provider/src/tasks/cache_user_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
)
WAUDIO_MINT_PUBKEY = PublicKey(WAUDIO_MINT_ADDRESS) if WAUDIO_MINT_ADDRESS else None

MAX_LAZY_REFRESH_USER_IDS = 100

class AssociatedWallets(TypedDict):
eth: List[str]
Expand Down Expand Up @@ -108,7 +109,7 @@ def refresh_user_ids(
waudio_token,
):
with db.scoped_session() as session:
lazy_refresh_user_ids = get_lazy_refresh_user_ids(redis, session)
lazy_refresh_user_ids = get_lazy_refresh_user_ids(redis, session)[:MAX_LAZY_REFRESH_USER_IDS]
immediate_refresh_user_ids = get_immediate_refresh_user_ids(redis)

logger.info(
Expand Down

0 comments on commit 2108346

Please sign in to comment.