diff --git a/r2/r2/models/account.py b/r2/r2/models/account.py index 4bdc987af..bcab96117 100644 --- a/r2/r2/models/account.py +++ b/r2/r2/models/account.py @@ -820,5 +820,10 @@ class AccountsActiveBySR(tdb_cassandra.View): {account._id36: ''}) @classmethod - def get_count(cls, sr): - return cls._cf.get_count(sr._id36) + def get_count(cls, sr, cached=True): + return cls.get_count_cached(sr._id36, _update=not cached) + + @classmethod + @memoize('accounts_active', time=60) + def get_count_cached(cls, sr_id): + return cls._cf.get_count(sr_id)