fix lots of rebase errors
This commit is contained in:
parent
c32ebdd4cd
commit
152714ca03
8 changed files with 12 additions and 67 deletions
|
|
@ -156,7 +156,6 @@ export type PureRenoteOption = Option & { renote: MiNote } & ({ text?: null } |
|
|||
@Injectable()
|
||||
export class NoteCreateService implements OnApplicationShutdown {
|
||||
#shutdownController = new AbortController();
|
||||
// private updateNotesCountQueue: CollapsedQueue<MiNote['id'], number>;
|
||||
|
||||
constructor(
|
||||
@Inject(DI.config)
|
||||
|
|
@ -230,7 +229,6 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
private readonly noteVisibilityService: NoteVisibilityService,
|
||||
private readonly collapsedQueueService: CollapsedQueueService,
|
||||
) {
|
||||
//this.updateNotesCountQueue = new CollapsedQueue(this.timeService, process.env.NODE_ENV !== 'test' ? 60 * 1000 * 5 : 0, this.collapseNotesCount, this.performUpdateNotesCount);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
@ -1034,23 +1032,11 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Moved to CollapsedQueueService
|
||||
/*
|
||||
@bindThis
|
||||
private collapseNotesCount(oldValue: number, newValue: number) {
|
||||
return oldValue + newValue;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async performUpdateNotesCount(id: MiNote['id'], incrBy: number) {
|
||||
await this.instancesRepository.increment({ id: id }, 'notesCount', incrBy);
|
||||
}
|
||||
*/
|
||||
// collapseNotesCount moved to CollapsedQueueService
|
||||
|
||||
@bindThis
|
||||
public async dispose(): Promise<void> {
|
||||
this.#shutdownController.abort();
|
||||
// await this.updateNotesCountQueue.performAllNow();
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
|
|||
|
|
@ -222,7 +222,8 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
private readonly timeService: TimeService,
|
||||
private readonly noteVisibilityService: NoteVisibilityService,
|
||||
private readonly collapsedQueueService: CollapsedQueueService,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async edit(user: MiUser, editid: MiNote['id'], data: Option, silent = false): Promise<MiNote> {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import { ModuleRef } from '@nestjs/core';
|
|||
import { DI } from '@/di-symbols.js';
|
||||
import type { EmojisRepository, NoteReactionsRepository, UsersRepository, NotesRepository, MiMeta } from '@/models/_.js';
|
||||
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||
import { isLocalUser, isRemoteUser } from '@/models/User.js';
|
||||
import type { MiRemoteUser, MiUser } from '@/models/User.js';
|
||||
import { isLocalUser, isRemoteUser } from '@/models/User.js';
|
||||
import type { MiNote } from '@/models/Note.js';
|
||||
import { IdService } from '@/core/IdService.js';
|
||||
import { MiNoteReaction } from '@/models/NoteReaction.js';
|
||||
|
|
@ -19,7 +19,6 @@ import { NotificationService } from '@/core/NotificationService.js';
|
|||
import PerUserReactionsChart from '@/core/chart/charts/per-user-reactions.js';
|
||||
import { emojiRegex } from '@/misc/emoji-regex.js';
|
||||
import { ApDeliverManagerService } from '@/core/activitypub/ApDeliverManagerService.js';
|
||||
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
||||
import { ApRendererService } from '@/core/activitypub/ApRendererService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { UtilityService } from '@/core/UtilityService.js';
|
||||
|
|
@ -299,7 +298,7 @@ export class ReactionService implements OnModuleInit {
|
|||
if (['public', 'home', 'followers'].includes(note.visibility)) {
|
||||
dm.addFollowersRecipe();
|
||||
} else if (note.visibility === 'specified') {
|
||||
const visibleUsers = await this.cacheService.getUsers(note.visibleUserIds);
|
||||
const visibleUsers = await this.cacheService.findUsersById(note.visibleUserIds);
|
||||
for (const u of visibleUsers.values()) {
|
||||
if (isRemoteUser(u)) {
|
||||
dm.addDirectRecipe(u as MiRemoteUser);
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ import { IdentifiableError } from '@/misc/identifiable-error.js';
|
|||
import { toArray } from '@/misc/prelude/array.js';
|
||||
import { isPureRenote } from '@/misc/is-renote.js';
|
||||
import { CacheService } from '@/core/CacheService.js';
|
||||
import { trackPromise } from '@/misc/promise-tracker.js';
|
||||
import { promiseMap } from '@/misc/promise-map.js';
|
||||
import { trackPromise } from '@/misc/promise-tracker.js';
|
||||
import { renderInlineError } from '@/misc/render-inline-error.js';
|
||||
import { AnyCollection, getApId, getNullableApId, IObjectWithId, isCollection, isCollectionOrOrderedCollection, isCollectionPage, isOrderedCollection, isOrderedCollectionPage } from './type.js';
|
||||
import { ApDbResolverService } from './ApDbResolverService.js';
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ export class ApPersonService implements OnModuleInit {
|
|||
private readonly publicKeyByUserIdCache: ManagedQuantumKVCache<MiUserPublickey>;
|
||||
|
||||
private driveFileEntityService: DriveFileEntityService;
|
||||
private idService: IdService;
|
||||
private federatedInstanceService: FederatedInstanceService;
|
||||
private fetchInstanceMetadataService: FetchInstanceMetadataService;
|
||||
private cacheService: CacheService;
|
||||
|
|
@ -88,6 +87,7 @@ export class ApPersonService implements OnModuleInit {
|
|||
private instanceChart: InstanceChart;
|
||||
private accountMoveService: AccountMoveService;
|
||||
private logger: Logger;
|
||||
private idService: IdService;
|
||||
|
||||
constructor(
|
||||
private moduleRef: ModuleRef,
|
||||
|
|
@ -184,7 +184,6 @@ export class ApPersonService implements OnModuleInit {
|
|||
@bindThis
|
||||
onModuleInit(): void {
|
||||
this.driveFileEntityService = this.moduleRef.get('DriveFileEntityService');
|
||||
this.idService = this.moduleRef.get('IdService');
|
||||
this.federatedInstanceService = this.moduleRef.get('FederatedInstanceService');
|
||||
this.fetchInstanceMetadataService = this.moduleRef.get('FetchInstanceMetadataService');
|
||||
this.cacheService = this.moduleRef.get('CacheService');
|
||||
|
|
@ -197,6 +196,7 @@ export class ApPersonService implements OnModuleInit {
|
|||
this.usersChart = this.moduleRef.get('UsersChart');
|
||||
this.instanceChart = this.moduleRef.get('InstanceChart');
|
||||
this.accountMoveService = this.moduleRef.get('AccountMoveService');
|
||||
this.idService = this.moduleRef.get('IdService');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -997,25 +997,6 @@ export class ApPersonService implements OnModuleInit {
|
|||
});
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async resolveUserForFeatured(userOrId: MiRemoteUser | MiUser['id']): Promise<(MiRemoteUser & { featured: string }) | null> {
|
||||
const userId = typeof(userOrId) === 'object' ? userOrId.id : userOrId;
|
||||
const user = typeof(userOrId) === 'object' ? userOrId : await this.cacheService.findRemoteUserById(userId);
|
||||
|
||||
if (user.isDeleted || user.isSuspended) {
|
||||
this.logger.debug(`Not updating featured for ${userId}: user is deleted`);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!user.featured) {
|
||||
this.logger.debug(`Not updating featured for ${userId}: no featured collection`);
|
||||
return null;
|
||||
}
|
||||
|
||||
// For some reason TS doesn't recognize the type check above.
|
||||
return user as MiRemoteUser & { featured: string };
|
||||
}
|
||||
|
||||
/**
|
||||
* リモート由来のアカウント移行処理を行います
|
||||
* @param src 移行元アカウント(リモートかつupdatePerson後である必要がある、というかこれ自体がupdatePersonで呼ばれる前提)
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ export class BackgroundTaskProcessorService {
|
|||
if (user.isSuspended) return `Skipping post-note task: note ${task.noteId}'s user ${note.userId} is suspended`;
|
||||
note.user = user;
|
||||
|
||||
const mentionedUsers = await this.cacheService.getUsers(note.mentions);
|
||||
const mentionedUsers = await this.cacheService.findUsersById(note.mentions);
|
||||
const poll = await this.pollsRepository.findOneBy({ noteId: note.id });
|
||||
|
||||
if (task.edit) {
|
||||
|
|
|
|||
|
|
@ -299,30 +299,8 @@ export class InboxProcessorService implements OnApplicationShutdown {
|
|||
return 'ok';
|
||||
}
|
||||
|
||||
// Moved to CollapsedQueueService
|
||||
/*
|
||||
@bindThis
|
||||
public collapseUpdateInstanceJobs(oldJob: UpdateInstanceJob, newJob: UpdateInstanceJob) {
|
||||
const latestRequestReceivedAt = oldJob.latestRequestReceivedAt < newJob.latestRequestReceivedAt
|
||||
? newJob.latestRequestReceivedAt
|
||||
: oldJob.latestRequestReceivedAt;
|
||||
const shouldUnsuspend = oldJob.shouldUnsuspend || newJob.shouldUnsuspend;
|
||||
return {
|
||||
latestRequestReceivedAt,
|
||||
shouldUnsuspend,
|
||||
};
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async performUpdateInstance(id: string, job: UpdateInstanceJob) {
|
||||
await this.federatedInstanceService.update(id, {
|
||||
latestRequestReceivedAt: this.timeService.date,
|
||||
isNotResponding: false,
|
||||
// もしサーバーが死んでるために配信が止まっていた場合には自動的に復活させてあげる
|
||||
suspensionState: job.shouldUnsuspend ? 'none' : undefined,
|
||||
});
|
||||
}
|
||||
*/
|
||||
// collapseUpdateInstanceJobs moved to CollapsedQueueService
|
||||
// performUpdateInstance moved to CollapsedQueueService
|
||||
|
||||
@bindThis
|
||||
public async dispose(): Promise<void> {}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import { CacheManagementService } from '@/global/CacheManagementService.js';
|
|||
import { ApResolverService } from '@/core/activitypub/ApResolverService.js';
|
||||
import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js';
|
||||
import type { IActor, IApDocument, ICollection, IObject, IPost } from '@/core/activitypub/type.js';
|
||||
import { MiMeta, MiNote, MiUser, MiUserKeypair, UserNotePiningsRepository, UserProfilesRepository, UserPublickeysRepository, UserKeypairsRepository, UsersRepository, NotesRepository } from '@/models/_.js';
|
||||
import { MiMeta, MiNote, MiUser, MiUserKeypair, UserProfilesRepository, UserPublickeysRepository, UserKeypairsRepository, UsersRepository, NotesRepository, UserNotePiningsRepository } from '@/models/_.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { secureRndstr } from '@/misc/secure-rndstr.js';
|
||||
import { DownloadService } from '@/core/DownloadService.js';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue