Move no cars found so logs can be read
All checks were successful
Build, Push and Run Container / build (push) Successful in 24s

This commit is contained in:
2025-08-17 12:29:12 +02:00
parent f724e59f7f
commit 947a1313c8

View File

@@ -254,8 +254,6 @@ if (app.Environment.IsDevelopment())
string[] vins = vehiclesEnvelope?.Response.Select(x => x.Vin ?? "").Where(v => !String.IsNullOrWhiteSpace(v)).ToArray() ?? Array.Empty<string>();
logger.LogCritical("User has access to {count} cars: {vins}", vins.Length, String.Join(", ", vins));
if (vins.Length == 0)
return Results.Ok("No cars found");
//Get CA from validate server file
string fileContent = await File.ReadAllTextAsync("Resources/validate_server.json");
@@ -281,6 +279,9 @@ if (app.Environment.IsDevelopment())
};
logger.LogInformation("Config request: {configRequest}", JsonSerializer.Serialize(configRequest, new JsonSerializerOptions() { WriteIndented = true }));
if (vins.Length == 0)
return Results.Ok("No cars found");
client.BaseAddress = new Uri("https://fleet-api.prd.eu.vn.cloud.tesla.com");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {access_token}");
client.DefaultRequestHeaders.Add("X-Tesla-User-Agent", "Tesla-Connector/1.0.0");