-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from AngeloDotNet/develop
Sync Main from Develop
- Loading branch information
Showing
8 changed files
with
107 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Microsoft.Extensions.Logging; | ||
using Polly; | ||
using Polly.Retry; | ||
|
||
namespace GSWCloudApp.Common.Polly; | ||
|
||
public static class DependencyInjection | ||
{ | ||
public static AsyncRetryPolicy GetRetryPolicy(ILogger logger) | ||
{ | ||
return Policy.Handle<Exception>().WaitAndRetryAsync( | ||
retryCount: 3, // Numero di tentativi | ||
sleepDurationProvider: attempt => TimeSpan.FromSeconds(Math.Pow(5, attempt)), // Intervallo esponenziale | ||
onRetry: (exc, timespan, attempt, context) | ||
=> logger.LogWarning(exc, "Tentativo {Attempt} fallito. Riprovo tra {TimespanSeconds} secondi.", attempt, timespan.TotalSeconds)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...oudApp.Common/RedisCache/ICacheService.cs → ...mmon/RedisCache/Services/ICacheService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/GSWCloudApp.Common/Settings/SendEmail/SenderSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace GSWCloudApp.Common.Settings.SendEmail; | ||
|
||
/// <summary> | ||
/// Represents the settings for the email sender. | ||
/// </summary> | ||
public class SenderSettings | ||
{ | ||
/// <summary> | ||
/// Gets or sets the name of the sender. | ||
/// </summary> | ||
public string Name { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// Gets or sets the email address of the sender. | ||
/// </summary> | ||
public string Email { get; set; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using MailKit.Security; | ||
|
||
namespace GSWCloudApp.Common.Settings.SendEmail; | ||
|
||
/// <summary> | ||
/// Represents the settings required to configure an SMTP client. | ||
/// </summary> | ||
public class SmtpSettings | ||
{ | ||
/// <summary> | ||
/// Gets or sets the SMTP server host. | ||
/// </summary> | ||
public string Host { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// Gets or sets the port number to use for the SMTP server. | ||
/// </summary> | ||
public int Port { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the security options for the SMTP connection. | ||
/// </summary> | ||
public SecureSocketOptions Security { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the username for the SMTP server authentication. | ||
/// </summary> | ||
public string? Username { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the password for the SMTP server authentication. | ||
/// </summary> | ||
public string? Password { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters