Skip to content

Commit

Permalink
Set up Storage always (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
varunpuranik authored Oct 17, 2018
1 parent 8ead765 commit e0a1a08
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,19 @@ internal static Option<UpstreamProtocol> GetUpstreamProtocol(IConfigurationRoot

(bool isEnabled, bool usePersistentStorage, StoreAndForwardConfiguration config, string storagePath) GetStoreAndForwardConfiguration()
{
int defaultTtl = -1;
bool isEnabled = this.configuration.GetValue<bool>("storeAndForwardEnabled");
int defaultTtl = -1;
bool usePersistentStorage = this.configuration.GetValue<bool>("usePersistentStorage");
int timeToLiveSecs = defaultTtl;
string storagePath = string.Empty;
if (isEnabled)
string storagePath = this.GetStoragePath();
bool storeAndForwardEnabled = this.configuration.GetValue<bool>("storeAndForwardEnabled");
if (storeAndForwardEnabled)
{
IConfiguration storeAndForwardConfigurationSection = this.configuration.GetSection("storeAndForward");
timeToLiveSecs = storeAndForwardConfigurationSection.GetValue("timeToLiveSecs", defaultTtl);

if (usePersistentStorage)
{
storagePath = this.GetStoragePath();
}
}

var storeAndForwardConfiguration = new StoreAndForwardConfiguration(timeToLiveSecs);
return (isEnabled, usePersistentStorage, storeAndForwardConfiguration, storagePath);
return (storeAndForwardEnabled, usePersistentStorage, storeAndForwardConfiguration, storagePath);
}

string GetStoragePath()
Expand Down

0 comments on commit e0a1a08

Please sign in to comment.