faster-get-author
Some checks failed
Deploy on push / deploy (push) Failing after 8s

This commit is contained in:
2024-02-25 19:02:15 +03:00
parent 1e922e3161
commit b12db9af0e
2 changed files with 16 additions and 10 deletions

View File

@@ -21,7 +21,7 @@ DEFAULT_FOLLOWS = {
async def update_author_cache(author: Author, ttl=25 * 60 * 60):
payload = json.dumps(author.dict())
await redis.execute('SETEX', f'user:{author.user}:author', ttl, payload)
await redis.execute('SETEX', f'id:{author.user}:author', ttl, payload)
await redis.execute('SETEX', f'id:{author.id}:author', ttl, payload)
@event.listens_for(Shout, 'after_insert')