perf(backend): createdAtをidから取得するように & 無駄なDateインスタンスの生成を避けるように
This commit is contained in:
parent
15706c8c2b
commit
1fa1d31696
171 changed files with 442 additions and 537 deletions
|
@ -17,6 +17,7 @@ import { deepClone } from '@/misc/clone.js';
|
|||
import { bindThis } from '@/decorators.js';
|
||||
import { isMimeImage } from '@/misc/is-mime-image.js';
|
||||
import { isNotNull } from '@/misc/is-not-null.js';
|
||||
import { IdService } from '@/core/IdService.js';
|
||||
import { UtilityService } from '../UtilityService.js';
|
||||
import { VideoProcessingService } from '../VideoProcessingService.js';
|
||||
import { UserEntityService } from './UserEntityService.js';
|
||||
|
@ -44,6 +45,7 @@ export class DriveFileEntityService {
|
|||
private utilityService: UtilityService,
|
||||
private driveFolderEntityService: DriveFolderEntityService,
|
||||
private videoProcessingService: VideoProcessingService,
|
||||
private idService: IdService,
|
||||
) {
|
||||
}
|
||||
|
||||
|
@ -196,7 +198,7 @@ export class DriveFileEntityService {
|
|||
|
||||
return await awaitAll<Packed<'DriveFile'>>({
|
||||
id: file.id,
|
||||
createdAt: file.createdAt.toISOString(),
|
||||
createdAt: this.idService.parse(file.id).date.toISOString(),
|
||||
name: file.name,
|
||||
type: file.type,
|
||||
md5: file.md5,
|
||||
|
@ -231,7 +233,7 @@ export class DriveFileEntityService {
|
|||
|
||||
return await awaitAll<Packed<'DriveFile'>>({
|
||||
id: file.id,
|
||||
createdAt: file.createdAt.toISOString(),
|
||||
createdAt: this.idService.parse(file.id).date.toISOString(),
|
||||
name: file.name,
|
||||
type: file.type,
|
||||
md5: file.md5,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue