From 4f6ee895e725c8e27c04fc94f432d0a2cd71adc5 Mon Sep 17 00:00:00 2001 From: Dmitry Sergeev Date: Thu, 27 Aug 2026 09:12:17 +0300 Subject: [PATCH] move MXL retry policy to adapter --- internal/{playback/source_retry.go => adapter/mxl/retry.go} | 5 +++-- .../source_retry_test.go => adapter/mxl/retry_test.go} | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) rename internal/{playback/source_retry.go => adapter/mxl/retry.go} (71%) rename internal/{playback/source_retry_test.go => adapter/mxl/retry_test.go} (94%) diff --git a/internal/playback/source_retry.go b/internal/adapter/mxl/retry.go similarity index 71% rename from internal/playback/source_retry.go rename to internal/adapter/mxl/retry.go index f0e12a8..0cbbe92 100644 --- a/internal/playback/source_retry.go +++ b/internal/adapter/mxl/retry.go @@ -1,4 +1,4 @@ -package playback +package mxladapter import ( "context" @@ -6,7 +6,8 @@ import ( "mxl-player/internal/source" ) -func shouldRetrySourceError(err error) bool { +// ShouldRetry reports whether an MXL source error should start another attempt. +func ShouldRetry(err error) bool { if errors.Is(err, context.Canceled) { return false } diff --git a/internal/playback/source_retry_test.go b/internal/adapter/mxl/retry_test.go similarity index 94% rename from internal/playback/source_retry_test.go rename to internal/adapter/mxl/retry_test.go index de127e1..5475ea4 100644 --- a/internal/playback/source_retry_test.go +++ b/internal/adapter/mxl/retry_test.go @@ -1,4 +1,4 @@ -package playback +package mxladapter import ( "context" @@ -66,7 +66,7 @@ func TestShouldRetrySourceError(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := shouldRetrySourceError(tt.err); got != tt.want { + if got := ShouldRetry(tt.err); got != tt.want { t.Errorf("shouldRetrySourceError() = %t, want %t", got, tt.want) } })