fix(user): fix missing greenlet when invalidating cache
This commit is contained in:
@@ -49,9 +49,8 @@ async def upload_avatar(
|
||||
await storage.write_file(storage_path, content, f"image/{format_}")
|
||||
url = await storage.get_file_url(storage_path)
|
||||
current_user.avatar_url = url
|
||||
await session.commit()
|
||||
|
||||
await cache_service.invalidate_user_cache(current_user.id)
|
||||
await session.commit()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
|
||||
@@ -50,9 +50,8 @@ async def upload_cover(
|
||||
await storage.write_file(storage_path, content, f"image/{format_}")
|
||||
url = await storage.get_file_url(storage_path)
|
||||
current_user.cover = UserProfileCover(url=url)
|
||||
await session.commit()
|
||||
|
||||
await cache_service.invalidate_user_cache(current_user.id)
|
||||
await session.commit()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
|
||||
@@ -81,9 +81,8 @@ async def user_rename(
|
||||
"previous_username": current_user.previous_usernames[-1],
|
||||
}
|
||||
session.add(rename_event)
|
||||
await session.commit()
|
||||
|
||||
await cache_service.invalidate_user_cache(current_user.id)
|
||||
await session.commit()
|
||||
|
||||
return None
|
||||
|
||||
|
||||
@@ -247,5 +247,5 @@ async def favourite_beatmapset(
|
||||
db.add(favourite)
|
||||
else:
|
||||
await db.delete(existing_favourite)
|
||||
await db.commit()
|
||||
await cache_service.invalidate_user_beatmapsets_cache(current_user.id)
|
||||
await db.commit()
|
||||
|
||||
Reference in New Issue
Block a user