@@ -73,7 +73,7 @@ public async Task<ChatRequestResult> EnqueueChatRequestAsync(ChatRequestCommand
7373 LogChatRequestCommand ( command ) ;
7474
7575 _ = Task . Run ( async ( ) => {
76- await ProcessChatRequestInternalAsync ( preprocessContext ) ;
76+ await ProcessChatRequestInternalAsync ( preprocessContext ) . ConfigureAwait ( false ) ;
7777 } ) ;
7878
7979 return ChatRequestResult . Accepted ( command . Id . ToString ( ) , command . UserId , command . CharacterId ) ;
@@ -109,20 +109,18 @@ private async Task ProcessChatRequestInternalAsync(ChatProcessContext context)
109109 {
110110 using var scope = _scopeFactory . CreateScope ( ) ;
111111 try {
112- await _llmProcessor . ProcessAsync ( context ) ;
113- await _ttsProcessor . ProcessAsync ( context ) ;
112+ await _llmProcessor . ProcessAsync ( context ) . ConfigureAwait ( false ) ;
113+ await _ttsProcessor . ProcessAsync ( context ) . ConfigureAwait ( false ) ;
114114
115- // ChatSuccessHandler와 ChatResultProcessor를 같은 스코프에서 실행
116-
117115 var successHandler = scope . ServiceProvider . GetRequiredService < ChatSuccessHandler > ( ) ;
118116 var resultProcessor = scope . ServiceProvider . GetRequiredService < ChatResultProcessor > ( ) ;
119-
120- await successHandler . HandleAsync ( context ) ;
121- await resultProcessor . PersistResultsAsync ( context ) ;
117+
118+ await successHandler . HandleAsync ( context ) . ConfigureAwait ( false ) ;
119+ await resultProcessor . PersistResultsAsync ( context ) . ConfigureAwait ( false ) ;
122120 }
123121 catch ( Exception ) {
124122 var failureHandler = scope . ServiceProvider . GetRequiredService < ChatFailureHandler > ( ) ;
125- await failureHandler . HandleAsync ( context ) ;
123+ await failureHandler . HandleAsync ( context ) . ConfigureAwait ( false ) ;
126124 }
127125 finally {
128126 LogChatProcessContext ( context ) ;
0 commit comments