perf(go): cache realtime plate lookups
This commit is contained in:
@@ -114,6 +114,18 @@ func TestRealtimeAPIDoesNotExposeDuplicateMileagePointRoute(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRealtimeAPICachesBindingPlateResolver(t *testing.T) {
|
||||
source, err := os.ReadFile("main.go")
|
||||
if err != nil {
|
||||
t.Fatalf("read main.go: %v", err)
|
||||
}
|
||||
for _, want := range []string{"NewCachedPlateResolver", "PLATE_CACHE_TTL_SECONDS"} {
|
||||
if !strings.Contains(string(source), want) {
|
||||
t.Fatalf("realtime api should configure cached plate resolver, missing %s", want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type contextCheckingRealtimeUpdater struct {
|
||||
ctxErr error
|
||||
count int
|
||||
|
||||
Reference in New Issue
Block a user