payloadLifespan/payloadLifetime and other name variants unified to Time To Live naming.
All checks were successful
Build and Push Docker Image / build (push) Successful in 55s
Build and Push Docker Image / docker (push) Successful in 36s

This commit is contained in:
2025-07-05 17:07:53 +02:00
parent 85c462a614
commit a44912ac87
25 changed files with 496 additions and 25 deletions

View File

@ -4,6 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
</Project>

View File

@ -31,7 +31,7 @@ namespace MessengerApi.Configuration.Model
/// <summary>
/// Message lifetime unless set differently in message body.
/// </summary>
public int DefaultMessageLifetimeInMinutes { get; set; }
public int DefaultMessageTimeToLiveInSeconds { get; set; }
/// <summary>
/// If true, messages are periodically wiped to free up space.
@ -72,7 +72,7 @@ namespace MessengerApi.Configuration.Model
this.Origins = origins ?? [];
this.Proxies = [];
this.RateLimitPerMinute = 120;
this.DefaultMessageLifetimeInMinutes = 1;
this.DefaultMessageTimeToLiveInSeconds = 60;
this.HousekeepingEnabled = true;
this.HousekeepingMessageAgeInMinutes = 120;
this.HousekeepingMessageState = HousekeepingMessageStates.None;
@ -85,7 +85,7 @@ namespace MessengerApi.Configuration.Model
{
Populate<string>(config, Env.PROXIES, x => this.Proxies = ProxiesParser.Parse(x));
Populate<int>(config, Env.QUERY_RATE_PER_MINUTE, x => this.RateLimitPerMinute = x);
Populate<int>(config, Env.DEFAULT_MESSAGE_LIFETIME_IN_MINUTES, x => this.DefaultMessageLifetimeInMinutes = x);
Populate<int>(config, Env.DEFAULT_MESSAGE_TIME_TO_LIVE_IN_SECONDS, x => this.DefaultMessageTimeToLiveInSeconds = x);
Populate<bool>(config, Env.HOUSEKEEPING_ENABLED, x => this.HousekeepingEnabled = x);
Populate<int>(config, Env.HOUSEKEEPING_MESSAGE_AGE_IN_MINUTES, x => this.HousekeepingMessageAgeInMinutes = x);
Populate<string>(config, Env.HOUSEKEEPING_MESSAGE_STATE, x => this.HousekeepingMessageState = HousekeepingMessageStateParser.Parse(x));

View File

@ -10,7 +10,7 @@
public const string CORS_ORIGINS = nameof(CORS_ORIGINS);
public const string PROXIES = nameof(PROXIES);
public const string QUERY_RATE_PER_MINUTE = nameof(QUERY_RATE_PER_MINUTE);
public const string DEFAULT_MESSAGE_LIFETIME_IN_MINUTES = nameof(DEFAULT_MESSAGE_LIFETIME_IN_MINUTES);
public const string DEFAULT_MESSAGE_TIME_TO_LIVE_IN_SECONDS = nameof(DEFAULT_MESSAGE_TIME_TO_LIVE_IN_SECONDS);
public const string HOUSEKEEPING_ENABLED = nameof(HOUSEKEEPING_ENABLED);
public const string HOUSEKEEPING_MESSAGE_AGE_IN_MINUTES = nameof(HOUSEKEEPING_MESSAGE_AGE_IN_MINUTES);
public const string HOUSEKEEPING_MESSAGE_STATE = nameof(HOUSEKEEPING_MESSAGE_STATE);