Commit:
50a8783Parent:
99f1497Disable retries for timeouts for SmsSender
.containerfile
+1
-1
diff --git a/.containerfile b/.containerfile
index 997ca15..6d4a22b 100644
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0.203 AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0.300 AS build
WORKDIR /app
MatDenDagen/Program.cs
+0
-2
diff --git a/MatDenDagen/Program.cs b/MatDenDagen/Program.cs
index 35323ec..467ff72 100644
@@ -14,8 +14,6 @@ var builder = WebApplication.CreateBuilder(args);
builder.ConfigureOpenTelemetry();
builder.Services.ConfigureHttpClientDefaults(http => http.AddStandardResilienceHandler());
builder
.Services.AddStorageServices()
.AddAdminService()
MatDenDagen/Services/NotificationService.cs
+10
-1
diff --git a/MatDenDagen/Services/NotificationService.cs b/MatDenDagen/Services/NotificationService.cs
index 9c6edba..3087f26 100644
@@ -81,7 +81,16 @@ public sealed class NotificationService(
Content = $"Mat den Dagen påminnelse: Dagen är här! {theDay:yyyy-MM-dd}",
};
await smsClient.SendSmsAsync(request, cancellationToken: cancellationToken);
var result = await smsClient.SendSmsAsync(request, cancellationToken: cancellationToken);
if (result.Status is not SmsStatus.Success)
{
logger.LogError(
"Failed to send notification to {PhoneNumber} with status {SmsStatus}",
participant.PhoneNumber,
result.Status
);
return;
}
logger.LogDebug(
"Notification sent successfully to {PhoneNumber}: {Message}",
MatDenDagen/SmsSenderServiceExtensions.cs
+7
-1
diff --git a/MatDenDagen/SmsSenderServiceExtensions.cs b/MatDenDagen/SmsSenderServiceExtensions.cs
index 6aa2572..d434422 100644
@@ -18,7 +18,13 @@ public static class SmsSenderServiceExtensions
.ConfigureHttpClient(
(sp, client) =>
client.BaseAddress = sp.GetRequiredService<IOptions<SmsSenderOptions>>().Value.BaseAddress
);
)
.AddStandardResilienceHandler(options =>
{
var timeout = TimeSpan.FromSeconds(120);
options.AttemptTimeout.Timeout = options.TotalRequestTimeout.Timeout = timeout;
options.CircuitBreaker.SamplingDuration = timeout * 2;
});
return services;
}
MatDenDagen/packages.lock.json
+3
-3
diff --git a/MatDenDagen/packages.lock.json b/MatDenDagen/packages.lock.json
index d26b37d..090796d 100644
@@ -37,9 +37,9 @@
},
"Microsoft.AspNetCore.App.Internal.Assets": {
"type": "Direct",
"requested": "[10.0.7, )",
"resolved": "10.0.7",
"contentHash": "ao3i+ks0uOQ7FWacI1hqHkUczebmXrGkUB63Xhkc34QbSzG9nYBlDv9v5l6rtCrHMsDW+13kZlpJrSj1HXddqg=="
"requested": "[10.0.8, )",
"resolved": "10.0.8",
"contentHash": "v6KocthydFtUHBIRI29YsOHKOgsqcQubkNywVOxiYr4GSDSv+XO/AeyMJywlX+1tGUTGdydu/X7V+Tzeq4SsoA=="
},
"Microsoft.EntityFrameworkCore.Design": {
"type": "Direct",
global.json
+2
-2
diff --git a/global.json b/global.json
index 9a3b9ed..e98911e 100644
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "10.0.203",
"version": "10.0.300",
"rollForward": "disable"
},
"msbuild-sdks": {
"Microsoft.NET.Sdk.Web": "10.0.203"
"Microsoft.NET.Sdk.Web": "10.0.300"
}
}