From 535e348ec60575795bb073ff9098fd10412cdb4b Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Tue, 24 Nov 2020 23:39:37 +0200 Subject: [PATCH] TelemetryPublisherFirestore.cs Increase authorization renewal from 5min to 15min before expiry time. --- NucuCar.Telemetry/Publishers/TelemetryPublisherFirestore.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NucuCar.Telemetry/Publishers/TelemetryPublisherFirestore.cs b/NucuCar.Telemetry/Publishers/TelemetryPublisherFirestore.cs index 0bec8f9..d887108 100644 --- a/NucuCar.Telemetry/Publishers/TelemetryPublisherFirestore.cs +++ b/NucuCar.Telemetry/Publishers/TelemetryPublisherFirestore.cs @@ -87,6 +87,7 @@ namespace NucuCar.Telemetry.Publishers if (response?.StatusCode == HttpStatusCode.OK) { + Logger?.LogInformation("Firestore authentication OK!"); var jsonContent = await response.GetJson(); _idToken = jsonContent.GetProperty("idToken").ToString(); // Setup next expire. @@ -109,8 +110,8 @@ namespace NucuCar.Telemetry.Publishers return; } - // Check if the token is about to expire in the next 5 minutes. - if (DateTime.UtcNow.AddMinutes(5) < _authorizationExpiryTime) + // Check if the token is about to expire in the next 15 minutes. + if (DateTime.UtcNow.AddMinutes(15) < _authorizationExpiryTime) { return; }