Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public static class CommonParameters
public const string DefaultDatesDrequency = "Monthly";
public const string DefaultDatesAccount = "CLIENT:/BISAM/REPOSITORY/QA/SMALL_PORT.ACCT";
public const string DefaultLookupDirectory = "client:";
public static readonly string Quant_Custom_Max_Age = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("QUANT_CUSTOM_MAX_AGE"))
? Environment.GetEnvironmentVariable("QUANT_CUSTOM_MAX_AGE") : "5";
Comment on lines +41 to +42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static readonly string Quant_Custom_Max_Age = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("QUANT_CUSTOM_MAX_AGE"))
? Environment.GetEnvironmentVariable("QUANT_CUSTOM_MAX_AGE") : "5";
public static readonly string Quant_Custom_Max_Age = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("QUANT_CUSTOM_MAX_AGE"))
? Environment.GetEnvironmentVariable("QUANT_CUSTOM_MAX_AGE") : "5";

public const string SPARAccount = "client:/aapi/spar3_qa_test_document";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,20 @@ private void ProcessCalculations(ApiResponse<object> calculationResponse)
if (getStatusResponse.Headers.ContainsKey("Cache-Control"))
{
var maxAge = getStatusResponse.Headers["Cache-Control"][0];
var customQuantAgeInterval = int.TryParse(CommonParameters.Quant_Custom_Max_Age, out int ageValue) ? ageValue : 2;

if (string.IsNullOrWhiteSpace(maxAge))
{
Console.WriteLine("Sleeping for 2 seconds");
// Sleep for at least 2 seconds.
Thread.Sleep(2000);
{
Console.WriteLine($"Sleeping for {customQuantAgeInterval} seconds");
Thread.Sleep(customQuantAgeInterval * 1000);
}
else
{
var age = int.Parse(maxAge.Replace("max-age=", ""));

// setting minimum sleep time to 10 seconds.
age = (age <= 10 ? customQuantAgeInterval : age);

Console.WriteLine($"Sleeping for {age} seconds");
Thread.Sleep(age * 1000);
}
Expand Down
Loading