From 56ef76d6277fbf1152ffa4ebc030fd2faf373f2b Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Mon, 5 Mar 2018 11:31:39 +0100 Subject: [PATCH] File added. --- .../Commands/DomainObjectGrainFormatter.cs | 32 +++++++++++++++++++ .../EventSourcing/RetrySubscriptionTests.cs | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/Squidex.Infrastructure/Commands/DomainObjectGrainFormatter.cs diff --git a/src/Squidex.Infrastructure/Commands/DomainObjectGrainFormatter.cs b/src/Squidex.Infrastructure/Commands/DomainObjectGrainFormatter.cs new file mode 100644 index 000000000..d12406c11 --- /dev/null +++ b/src/Squidex.Infrastructure/Commands/DomainObjectGrainFormatter.cs @@ -0,0 +1,32 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System; +using Orleans; + +namespace Squidex.Infrastructure.Commands +{ + public static class DomainObjectGrainFormatter + { + public static string Format(IGrainCallContext context) + { + if (context.Method == null) + { + return "Unknown"; + } + + if (string.Equals(context.Method.Name, nameof(IDomainObjectGrain.ExecuteAsync), StringComparison.CurrentCultureIgnoreCase) && + context.Arguments?.Length == 1 && + context.Arguments[0] != null) + { + return context.Arguments[0].ToString(); + } + + return context.Method.Name; + } + } +} diff --git a/tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs b/tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs index bbb285bf8..74a7eca02 100644 --- a/tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs +++ b/tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs @@ -44,7 +44,7 @@ namespace Squidex.Infrastructure.EventSourcing { await OnErrorAsync(eventSubscription, new InvalidOperationException()); - await Task.Delay(200); + await Task.Delay(400); await sut.StopAsync();