Skip to content

Commit

Permalink
Updated Queue TTL to infinite for non net461 customers (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
amdeel authored Feb 1, 2022
1 parent 944f18e commit 6c1fda6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DurableTask.AzureStorage/Storage/Queue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ public Queue(AzureStorageClient azureStorageClient, CloudQueueClient queueClient

public async Task AddMessageAsync(QueueMessage queueMessage, TimeSpan? visibilityDelay, Guid? clientRequestId = null)
{
// Infinite time to live
TimeSpan? timeToLive = TimeSpan.FromSeconds(-1);
#if NET461
// When using net461 SDK version WindowsAzure.Storage 7.2.1 does not allow infinite time to live. Passing in null will default the time to live to 7 days.
timeToLive = null;
#endif
await this.azureStorageClient.MakeQueueStorageRequest(
(context, cancellationToken) => this.cloudQueue.AddMessageAsync(
queueMessage.CloudQueueMessage,
null /* timeToLive */,
timeToLive,
visibilityDelay,
null,
context),
Expand Down

0 comments on commit 6c1fda6

Please sign in to comment.