-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix avatar/banner proxy #8346
Fix avatar/banner proxy #8346
Conversation
Co-authored-by: mei23 <m@m544.net>
例のごとくp1.a9z.devで試験中 |
if (src.avatar === undefined && src.avatarId) src.avatar = await DriveFiles.findOne(src.avatarId) || null; | ||
if (src.banner === undefined && src.bannerId) src.banner = await DriveFiles.findOne(src.bannerId) || null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
タイムラインとか取得する場合だとクエリの数が結構増えてしまいそう
クエリのレイテンシが遅くて20ms程度ある環境を考えると 20 * 2(avatar, banner) * 2(リプライとか引用先のユーザー) * 10(タイムラインの投稿の数) = 800 でAPIのレスポンスが一秒くらい遅くなりそう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
プロキシの設定はそんなに頻繁に変わらないと思うから長めにキャッシュしても良さそう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
タイムラインAPIから呼ばれた時はsrc.avatar
が既に入ってる前提だった気がする(覚えてない)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
いやしてない。タイムラインクエリで User.avatar => DriveFile にJOINしないといけない。
/avatarの動作を変える必要がある |
いやないか? |
TypeORMわからん |
引き継ぐわ |
とりあえずタイムライン系のAPIでJOINするようにした |
🙏🏻🙏🏻🙏🏻 |
Fix #7601
Fix #7602
#7767 を復活