refactor(go): keep realtime cache vin scoped

This commit is contained in:
lingniu
2026-07-03 08:12:21 +08:00
parent 400047e08c
commit c2d058bf75
5 changed files with 33 additions and 33 deletions

View File

@@ -29,6 +29,9 @@ func NewRepository(client *redis.Client, cfg Config) *Repository {
func (r *Repository) Update(ctx context.Context, env envelope.FrameEnvelope) error {
vin := strings.TrimSpace(env.VIN)
if vin == "" {
return nil
}
vehicleKey := strings.TrimSpace(env.VehicleKey())
if vehicleKey == "" || strings.HasSuffix(vehicleKey, ":unknown") {
return nil