This commit is contained in:
mattyatea 2024-05-11 00:05:48 +09:00
parent e270586662
commit ec41d0d1dc
3 changed files with 2 additions and 6 deletions

View File

@ -28,7 +28,6 @@ export class AccountUpdateService {
@bindThis
public async publishToFollowers(userId: MiUser['id']) {
console.time('time AccountUpdateService.publishToFollowers');
const user = await this.usersRepository.findOneBy({ id: userId });
if (user == null) throw new Error('user not found');
@ -38,6 +37,5 @@ export class AccountUpdateService {
this.apDeliverManagerService.deliverToFollowers(user, content);
this.relayService.deliverToRelays(user, content);
}
console.timeEnd('time AccountUpdateService.publishToFollowers');
}
}

View File

@ -33,7 +33,6 @@ export class RedisKVCache<T> {
@bindThis
public async set(key: string, value: T): Promise<void> {
console.time('time RedisKVCache.set');
this.memoryCache.set(key, value);
if (this.lifetime === Infinity) {
await this.redisClient.set(
@ -47,7 +46,6 @@ export class RedisKVCache<T> {
'EX', Math.round(this.lifetime / 1000),
);
}
console.timeEnd('time RedisKVCache.set');
}
@bindThis

View File

@ -362,7 +362,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const [myRoles, myPolicies] = await Promise.all([this.roleService.getUserRoles(user.id), this.roleService.getUserPolicies(user.id)]);
const allRoles = await this.roleService.getRoles();
const decorationIds = decorations
.filter(d => d.host === null && (d.roleIdsThatCanBeUsedThisDecoration.filter(roleId => allRoles.some(r => r.id === roleId)).length === 0 || myRoles.some(r => d.roleIdsThatCanBeUsedThisDecoration.includes(r.id))))
.filter(d => (d.roleIdsThatCanBeUsedThisDecoration.filter(roleId => allRoles.some(r => r.id === roleId)).length === 0 || myRoles.some(r => d.roleIdsThatCanBeUsedThisDecoration.includes(r.id))))
.map(d => d.id);
if (ps.avatarDecorations.length > myPolicies.avatarDecorationLimit) throw new ApiError(meta.errors.restrictedByRole);
@ -480,7 +480,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
await this.cacheService.userProfileCache.set(user.id, updatedProfile);
// Publish meUpdated event
//this.globalEventService.publishMainStream(user.id, 'meUpdated', iObj);
this.globalEventService.publishMainStream(user.id, 'meUpdated', iObj);
// 鍵垢を解除したとき、溜まっていたフォローリクエストがあるならすべて承認
if (user.isLocked && ps.isLocked === false) {