From 9f7a0df81b6b80e408a765e16e4c5fd65735b0ee Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Tue, 19 Mar 2024 14:27:39 +0800 Subject: [PATCH] fix:#701 --- .../Publisher.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs index 3afdb4531..a9839ec31 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs @@ -1,4 +1,4 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; @@ -19,18 +19,18 @@ public Publisher(IServiceProvider serviceProvider, string pubSubName, string app _serviceProvider = serviceProvider; _logger = serviceProvider.GetService>(); _pubSubName = pubSubName; + _appId = appId; + _daprAppId = daprAppId; + if (serviceProvider.EnableIsolation()) { - if (_daprAppId.IsNullOrWhiteSpace()) _logger?.LogError("Isolation is enabled but dapr AppId required for integration events is not configured"); + if (_daprAppId.IsNullOrWhiteSpace()) + _logger?.LogError("Isolation is enabled but dapr AppId required for integration events is not configured"); MasaArgumentException.ThrowIfNullOrWhiteSpace(daprAppId); } - - _appId = appId; - _daprAppId = daprAppId; } - public async Task PublishAsync( string topicName, T @event,