feat(similarity): add Worker skeleton with constructor + Run loop

This commit is contained in:
2026-04-28 20:02:15 -04:00
parent b0d1d6bb46
commit 9adad094b0
2 changed files with 88 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package similarity
import (
"io"
"log/slog"
"testing"
"time"
)
func TestNewWorker_DefaultsMatchSpec(t *testing.T) {
logger := slog.New(slog.NewTextHandler(io.Discard, nil))
w := NewWorker(nil, nil, logger)
if w.tick != 1*time.Hour {
t.Errorf("tick = %v, want 1h", w.tick)
}
if w.batch != 5 {
t.Errorf("batch = %d, want 5", w.batch)
}
if w.topK != 20 {
t.Errorf("topK = %d, want 20", w.topK)
}
}