User synchronization revamped.
This commit is contained in:
@ -53,16 +53,22 @@ namespace MessengerApi.Configuration.Model
|
||||
/// </summary>
|
||||
public HousekeepingMessageStates HousekeepingMessageState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File containing all user credentials.
|
||||
/// </summary>
|
||||
public FileInfo UsersConfig { get; set; }
|
||||
|
||||
public MessengerConfiguration() { }
|
||||
|
||||
public MessengerConfiguration(string[] origins, PersistenceConfiguration persistenceConfiguration)
|
||||
{
|
||||
if(persistenceConfiguration == null)
|
||||
if (persistenceConfiguration == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(persistenceConfiguration));
|
||||
}
|
||||
|
||||
this.PersistenceConfiguration = persistenceConfiguration;
|
||||
this.UsersConfig = new FileInfo("./users.conf");
|
||||
this.Origins = origins ?? [];
|
||||
this.Proxies = [];
|
||||
this.RateLimitPerMinute = 120;
|
||||
@ -84,6 +90,7 @@ namespace MessengerApi.Configuration.Model
|
||||
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));
|
||||
Populate<string>(config, Env.LOGGING_VERBOSITY, x => this.Verbosity = LoggingVerbosityParser.Parse(x));
|
||||
Populate<string>(config, Env.USERSCONFIG_FILE_PATH, x => this.UsersConfig = new FileInfo(x));
|
||||
|
||||
void Populate<T>(IEnvironmentConfigurationSource config, string key, Action<T> set)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user