From 491e173e07d2bb62955aebfa1896106143802831 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 29 Nov 2024 16:57:01 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=82=92=E3=81=99?= =?UTF-8?q?=E3=81=90=E3=81=AB=E8=BF=94=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/handler.go b/handler.go index 7f4f018..5e97464 100644 --- a/handler.go +++ b/handler.go @@ -105,6 +105,7 @@ func (s *Server) createSpeechHandler(serviceType string, onResultFunc func(conte c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) // すぐにヘッダを送信したい場合はここで c.Response().Flush() を実行する + c.Response().Flush() ctx := c.Request().Context() // TODO: context.WithCancelCause(ctx) に変更する @@ -170,7 +171,6 @@ func (s *Server) createSpeechHandler(serviceType string, onResultFunc func(conte retry: select { case <-retryTimer.C: - retryTimer.Stop() zlog.Info(). Err(err). Str("channel_id", h.SoraChannelID). @@ -189,7 +189,6 @@ func (s *Server) createSpeechHandler(serviceType string, onResultFunc func(conte Str("channel_id", h.SoraChannelID). Str("connection_id", h.SoraConnectionID). Msg("retry interrupted") - cancelServiceHandler() // リトライする前にクライアントとの接続でエラーが発生した場合は終了する return fmt.Errorf("%s", "retry interrupted") } @@ -478,7 +477,7 @@ func opus2ogg(ctx context.Context, opusCh chan opusChannel, sampleRate uint32, c return case opus, ok := <-opusCh: if !ok { - oggWriter.CloseWithError(fmt.Errorf("channel closed1")) + oggWriter.CloseWithError(io.EOF) return }