Skip to content

Commit

Permalink
AA
Browse files Browse the repository at this point in the history
  • Loading branch information
shishnk committed Apr 14, 2024
1 parent f06105b commit 238aa41
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public async Task<Result<string>> Execute(InvocationContext context,
return "Invalid format for resend interval. Please use the format hh:mm".ToResult();
}

if (minutes > 59) return "Minutes should be less than 60".ToResult();

var resendInterval = new TimeSpan(hours, minutes, 0);

if (resendInterval < TimeSpan.FromMinutes(30)) // hardcode
Expand Down Expand Up @@ -169,7 +171,7 @@ await cacheService.GetAsync<List<UserSubscriptionInfo>>("allSubscriptions",
{
var subscription = userSubscriptions[i];
message.AppendLine(
$"{i + 1}) Location: {subscription.Location}, resend interval: {subscription.ResendInterval.ToString(@"hh\:mm")}");
$"{i + 1}) Location: {subscription.Location}, resend interval: {(int)subscription.ResendInterval.TotalHours}:{subscription.ResendInterval.Minutes}");
}

return message.Length > 0
Expand Down Expand Up @@ -219,6 +221,8 @@ public async Task<Result<string>> Execute(InvocationContext context,
return "Invalid format for resend interval. Please use the format hh:mm".ToResult();
}

if (minutes > 59) return "Minutes should be less than 60".ToResult();

var resendInterval = new TimeSpan(hours, minutes, 0);

if (resendInterval < TimeSpan.FromMinutes(30)) // hardcode
Expand Down

0 comments on commit 238aa41

Please sign in to comment.