This commit is contained in:
@@ -124,8 +124,13 @@ class FollowsCached:
|
||||
authors = session.query(Author).all()
|
||||
total_authors = len(authors)
|
||||
for i in range(0, total_authors, BATCH_SIZE):
|
||||
batch_authors = authors[i:i+BATCH_SIZE]
|
||||
await asyncio.gather(*[FollowsCached.update_author_cache(author) for author in batch_authors])
|
||||
batch_authors = authors[i : i + BATCH_SIZE]
|
||||
await asyncio.gather(
|
||||
*[
|
||||
FollowsCached.update_author_cache(author)
|
||||
for author in batch_authors
|
||||
]
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
async def update_author_cache(author):
|
||||
@@ -154,5 +159,6 @@ class FollowsCached:
|
||||
except Exception as exc:
|
||||
logger.error(exc)
|
||||
|
||||
|
||||
async def start_cached_follows():
|
||||
await FollowsCached.worker()
|
||||
|
Reference in New Issue
Block a user