feat: two-store reconciler with safe repair and cost measurement (grade 5, track 2)

This commit is contained in:
2026-11-20 05:01:20 +03:00
parent 1c3011bf28
commit 60e8f4474b
36 changed files with 807 additions and 212 deletions
+5 -1
View File
@@ -11,6 +11,7 @@ import (
_ "image/png"
"io"
"net/http"
"strings"
"time"
"unicode"
"unicode/utf8"
@@ -159,7 +160,10 @@ func acquire(ctx context.Context, sem chan struct{}) error {
func release(sem chan struct{}) { <-sem }
func checkFilename(filename string) error {
if n := utf8.RuneCountInString(filename); n < 1 || n > maxFilenameRunes {
if strings.TrimSpace(filename) == "" {
return fmt.Errorf("%w: filename must not be blank", domain.ErrInvalidInput)
}
if n := utf8.RuneCountInString(filename); n > maxFilenameRunes {
return fmt.Errorf("%w: filename must be 1 to 255 characters", domain.ErrInvalidInput)
}
for _, r := range filename {