Skip to content

Commit 77d16ae

Browse files
committed
Fixed IdleSettings.WaitTimeout so that it will accept TimeSpan.Zero as the representation of "Do not wait". ($905) This could be a breaking change if previous code used TimeSpan.Zero to reset to the default of 1 hour.
1 parent 4dd05b1 commit 77d16ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

TaskService/Task.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ public bool StopOnIdleEnd
731731
/// </summary>
732732
/// <value>
733733
/// A value that indicates the amount of time that the Task Scheduler will wait for an idle condition to occur. The minimum time
734-
/// allowed is 1 minute. If this value is <c>TimeSpan.Zero</c>, then the delay will be set to the default of 1 hour.
734+
/// allowed is 1 minute. If this value is <c>TimeSpan.Zero</c>, then the delay will be the equivalent of "Do not wait".
735735
/// </value>
736736
[DefaultValue(typeof(TimeSpan), "01:00:00")]
737737
public TimeSpan WaitTimeout
@@ -749,7 +749,7 @@ public TimeSpan WaitTimeout
749749
{
750750
if (value != TimeSpan.Zero && value < TimeSpan.FromMinutes(1))
751751
throw new ArgumentOutOfRangeException(nameof(WaitTimeout));
752-
v2Settings.WaitTimeout = Task.TimeSpanToString(value);
752+
v2Settings.WaitTimeout = value == TimeSpan.Zero ? "PT0S" : Task.TimeSpanToString(value);
753753
}
754754
else
755755
{

0 commit comments

Comments
 (0)