perf(server): Reduce database query
This commit is contained in:
		@@ -259,13 +259,12 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	// Antenna
 | 
			
		||||
	Antennas.find().then(async antennas => {
 | 
			
		||||
		const followings = await Followings.createQueryBuilder('following')
 | 
			
		||||
	Followings.createQueryBuilder('following')
 | 
			
		||||
		.andWhere(`following.followeeId = :userId`, { userId: note.userId })
 | 
			
		||||
			.getMany();
 | 
			
		||||
 | 
			
		||||
		.getMany()
 | 
			
		||||
		.then(followings => {
 | 
			
		||||
			const followers = followings.map(f => f.followerId);
 | 
			
		||||
 | 
			
		||||
			Antennas.find().then(async antennas => {
 | 
			
		||||
				for (const antenna of antennas) {
 | 
			
		||||
					checkHitAntenna(antenna, note, user, followers).then(hit => {
 | 
			
		||||
						if (hit) {
 | 
			
		||||
@@ -274,6 +273,7 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
	// Channel
 | 
			
		||||
	if (note.channelId) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user