Фикс сохранения токена доступа
Some checks failed
Create and publish a Docker image / Publish image (push) Failing after 12s

This commit is contained in:
2025-11-17 02:18:27 +03:00
parent eb89b98326
commit 58fd8bfd68

View File

@@ -1,3 +1,4 @@
using ModeusSchedule.Abstractions;
using Quartz; using Quartz;
namespace SfeduSchedule.Jobs; namespace SfeduSchedule.Jobs;
@@ -15,7 +16,7 @@ public class UpdateJwtJob(
{ {
logger.LogInformation("Начало выполнения UpdateJwtJob"); logger.LogInformation("Начало выполнения UpdateJwtJob");
var authUrl = configuration["AUTH_URL"] ?? "http://msauth/auth/ms"; var authUrl = configuration["AUTH_URL"] ?? "http://msauth:8080/auth/ms";
var apiKey = configuration["AUTH_API_KEY"] ?? string.Empty; var apiKey = configuration["AUTH_API_KEY"] ?? string.Empty;
var client = httpClientFactory.CreateClient("authClient"); var client = httpClientFactory.CreateClient("authClient");
@@ -67,6 +68,7 @@ public class UpdateJwtJob(
} }
configuration["TOKEN"] = body.Jwt; configuration["TOKEN"] = body.Jwt;
await File.WriteAllTextAsync(GlobalConsts.JwtFilePath, body.Jwt + "\n" + DateTime.Now.ToString("O"), cts.Token);
logger.LogInformation("JWT успешно обновлён"); logger.LogInformation("JWT успешно обновлён");
return; return;
} }