Skip to content

Commit

Permalink
Merge pull request #191 from shiguredo/feature/add-retry-condition
Browse files Browse the repository at this point in the history
aws の再接続条件に InternalFailureException を追加する
  • Loading branch information
Hexa authored Nov 14, 2024
2 parents 4a0eb5f + a8186ac commit f07745f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

## develop

- [CHANGE] aws の再接続条件の exception に InternalFailureException を追加する
- @Hexa

### misc

## 2024.5.1
Expand Down
3 changes: 2 additions & 1 deletion amazon_transcribe_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ func (h *AmazonTranscribeHandler) Handle(ctx context.Context, reader io.Reader)

// 復帰が不可能なエラー以外は再接続を試みる
switch err.(type) {
case *transcribestreamingservice.LimitExceededException:
case *transcribestreamingservice.LimitExceededException,
*transcribestreamingservice.InternalFailureException:
// リトライしない設定の場合、または、max_retry を超えた場合はクライアントにエラーを返し、再度接続するかはクライアント側で判断する
if (at.Config.MaxRetry < 1) || (at.Config.MaxRetry <= h.GetRetryCount()) {
if err := encoder.Encode(NewSuzuErrorResponse(err)); err != nil {
Expand Down

0 comments on commit f07745f

Please sign in to comment.