refactor: remove dead RemoveClientAffinity code, add affinity scheduling tests

- Remove RemoveClientAffinity from GatewayCache interface, implementation,
  Lua script, and all test mocks (never called in production code)
- Add 26 unit tests for affinity scheduling: filterByMinAffinityCount,
  populateAffinityCounts, Layer 1/2 sort chain integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erioandClaude Opus 4.6 committed 2026-03-07 04:26:08 +08:00
1 parent d707c1f93f
commit b9dc2e8eb5
11 files changed
+607 -43

No files matched your search

@@ -294,9 +294,6 @@ func (m *mockGatewayCacheForGemini) GetClientAffinityAccounts(_ context.Context,
func (m *mockGatewayCacheForGemini) UpdateClientAffinity(_ context.Context, _ int64, _ string, _ int64, _ time.Duration) error {
return nil
}
func (m *mockGatewayCacheForGemini) RemoveClientAffinity(_ context.Context, _ int64, _ string, _ int64) error {
return nil
}
func (m *mockGatewayCacheForGemini) GetAccountAffinityCountBatch(_ context.Context, _ int64, _ []int64, _ time.Duration) (map[int64]int64, error) {
return map[int64]int64{}, nil
}