forked from mirrors/misskey
fix(chart): PerUserDriveChart.update で userId が null のシステム所有ファイルをスキップ (#17499)
fix(chart): PerUserDriveChart.update で userId が null のシステム所有ファイルをスキップ (#17498) Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
parent
2e1594245b
commit
3246dad53e
2 changed files with 5 additions and 0 deletions
|
|
@ -56,6 +56,10 @@ export default class PerUserDriveChart extends Chart<typeof schema> { // eslint-
|
|||
|
||||
@bindThis
|
||||
public async update(file: MiDriveFile, isAdditional: boolean): Promise<void> {
|
||||
// MiDriveFile.userId is nullable (system-owned files such as the instance
|
||||
// icon/banner, fetched system avatars, custom emoji image uploads, etc.).
|
||||
// Per-user drive accounting is not defined for ownerless files, so skip.
|
||||
if (file.userId == null) return;
|
||||
const fileSizeKb = file.size / 1000;
|
||||
await this.commit({
|
||||
'totalCount': isAdditional ? 1 : -1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue