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
6 changes: 0 additions & 6 deletions src/CommandLine/DefaultConfigurationValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,4 @@ public static class DefaultConfigurationValues

public static readonly string QueueNamePrefix = string.Empty;
public static readonly string TopicNamePrefix = string.Empty;

/* TODO: look into these, why are they different from the above?
public static readonly int AwsMaximumQueueDelayTime = (int)TimeSpan.FromMinutes(15).TotalSeconds;
public static readonly TimeSpan DelayedDeliveryQueueMessageRetentionPeriod = TimeSpan.FromDays(4);
public static readonly int DelayedDeliveryQueueDelayTime = Convert.ToInt32(Math.Ceiling(MaximumQueueDelayTime.TotalSeconds));
*/
}
8 changes: 4 additions & 4 deletions src/CommandLine/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ static int Main(string[] args)
createCommand.AddOption(prefixOption);

var retentionPeriodInSecondsCommand = createCommand.Option("-t|--retention",
$"Retention Period in seconds (defaults to {DefaultConfigurationValues.RetentionPeriod.TotalSeconds} ) ", CommandOptionType.SingleValue);
$"Retention Period in seconds (defaults to {(int)DefaultConfigurationValues.RetentionPeriod.TotalSeconds} ) ", CommandOptionType.SingleValue);

createCommand.OnExecuteAsync(async ct =>
{
var endpointName = nameArgument.Value;
var retentionPeriodInSeconds = retentionPeriodInSecondsCommand.HasValue() ? double.Parse(retentionPeriodInSecondsCommand.Value()) : DefaultConfigurationValues.RetentionPeriod.TotalSeconds;
var retentionPeriodInSeconds = retentionPeriodInSecondsCommand.HasValue() ? int.Parse(retentionPeriodInSecondsCommand.Value()) : (int)DefaultConfigurationValues.RetentionPeriod.TotalSeconds;
var prefix = prefixOption.HasValue() ? prefixOption.Value() : DefaultConfigurationValues.QueueNamePrefix;

await CommandRunner.Run(accessKeyOption, secretOption, regionOption, (sqs, sns, s3) => Endpoint.Create(sqs, prefix, endpointName, retentionPeriodInSeconds));
Expand Down Expand Up @@ -140,8 +140,8 @@ static int Main(string[] args)

delayDeliverySupportCommand.OnExecuteAsync(async ct =>
{
var delayInSeconds = DefaultConfigurationValues.MaximumQueueDelayTime.TotalSeconds;
var retentionPeriodInSeconds = retentionPeriodInSecondsCommand.HasValue() ? double.Parse(retentionPeriodInSecondsCommand.Value()) : DefaultConfigurationValues.RetentionPeriod.TotalSeconds;
var delayInSeconds = (int)DefaultConfigurationValues.MaximumQueueDelayTime.TotalSeconds;
var retentionPeriodInSeconds = retentionPeriodInSecondsCommand.HasValue() ? int.Parse(retentionPeriodInSecondsCommand.Value()) : (int)DefaultConfigurationValues.RetentionPeriod.TotalSeconds;
var suffix = DefaultConfigurationValues.DelayedDeliveryQueueSuffix;

var endpointName = nameArgument.Value;
Expand Down
Loading