Skip to content

Commit 6ce4c1e

Browse files
committed
Let error in normal situation
1 parent 96329bc commit 6ce4c1e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Grumpy.MessageQueue.Msmq/MessageQueueManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public MessageQueueManager(ILogger logger)
2828
}
2929

3030
private const string PrivatePrefix = @"private$\";
31-
private string Path(string serverName, string name, bool privateQueue) => (Locale(serverName) ? "" : $"FormatName:DIRECT=OS:") + Name(name, privateQueue);
31+
private string Path(string serverName, string name, bool privateQueue) => (Locale(serverName) ? "" : "FormatName:DIRECT=OS:") + Name(name, privateQueue);
3232

3333
private string Name(string name, bool privateQueue)
3434
{

Grumpy.MessageQueue.Msmq/Queue.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,13 @@ public async Task<ITransactionalMessage> ReceiveAsync(int millisecondsTimeout, C
335335
}
336336
catch (Exception exception)
337337
{
338+
if (exception is TaskCanceledException taskCanceledException)
339+
{
340+
Logger.Warning(taskCanceledException, "Receive canceled {@Queue}", this);
341+
342+
return new TransactionalMessage();
343+
}
344+
338345
Logger.Warning(exception, "Error receiving message, retrying once {@Queue}", this);
339346

340347
DisconnectInternal();

0 commit comments

Comments
 (0)