fix(backend): 無制限にストリーミングのチャンネルに接続できる問題を修正
This commit is contained in:
		
							parent
							
								
									571566d476
								
							
						
					
					
						commit
						d3cdc08802
					
				
					 2 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -24,6 +24,7 @@
 | 
				
			||||||
- Fix: ActivityPubのエンティティタイプ判定で不明なタイプを受け取った場合でも処理を継続するように
 | 
					- Fix: ActivityPubのエンティティタイプ判定で不明なタイプを受け取った場合でも処理を継続するように
 | 
				
			||||||
  - キュー処理のつまりが改善される可能性があります
 | 
					  - キュー処理のつまりが改善される可能性があります
 | 
				
			||||||
- Fix: リバーシの対局設定の変更が反映されないのを修正
 | 
					- Fix: リバーシの対局設定の変更が反映されないのを修正
 | 
				
			||||||
 | 
					- Fix: 無制限にストリーミングのチャンネルに接続できる問題を修正
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## 2024.7.0
 | 
					## 2024.7.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,6 +20,8 @@ import type { ChannelsService } from './ChannelsService.js';
 | 
				
			||||||
import type { EventEmitter } from 'events';
 | 
					import type { EventEmitter } from 'events';
 | 
				
			||||||
import type Channel from './channel.js';
 | 
					import type Channel from './channel.js';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const MAX_CHANNELS_PER_CONNECTION = 32;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Main stream connection
 | 
					 * Main stream connection
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -255,6 +257,10 @@ export default class Connection {
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	@bindThis
 | 
						@bindThis
 | 
				
			||||||
	public connectChannel(id: string, params: JsonObject | undefined, channel: string, pong = false) {
 | 
						public connectChannel(id: string, params: JsonObject | undefined, channel: string, pong = false) {
 | 
				
			||||||
 | 
							if (this.channels.length >= MAX_CHANNELS_PER_CONNECTION) {
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		const channelService = this.channelsService.getChannelService(channel);
 | 
							const channelService = this.channelsService.getChannelService(channel);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (channelService.requireCredential && this.user == null) {
 | 
							if (channelService.requireCredential && this.user == null) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue