From 8ac284f1ec2b3b8d929f20c2a553176f6db89d21 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 4 Dec 2017 12:17:26 -0500 Subject: [PATCH] noop event write service --- .../NoopEventWriteService.cs | 19 +++++++++++++++++++ .../Utilities/ServiceCollectionExtensions.cs | 7 +++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/Core/Services/NoopImplementations/NoopEventWriteService.cs diff --git a/src/Core/Services/NoopImplementations/NoopEventWriteService.cs b/src/Core/Services/NoopImplementations/NoopEventWriteService.cs new file mode 100644 index 0000000000..b0d79041ae --- /dev/null +++ b/src/Core/Services/NoopImplementations/NoopEventWriteService.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.WindowsAzure.Storage.Table; + +namespace Bit.Core.Services +{ + public class NoopEventWriteService : IEventWriteService + { + public Task CreateAsync(ITableEntity entity) + { + return Task.FromResult(0); + } + + public Task CreateManyAsync(IList entities) + { + return Task.FromResult(0); + } + } +} diff --git a/src/Core/Utilities/ServiceCollectionExtensions.cs b/src/Core/Utilities/ServiceCollectionExtensions.cs index 82e1cdea88..511f12ec1f 100644 --- a/src/Core/Utilities/ServiceCollectionExtensions.cs +++ b/src/Core/Utilities/ServiceCollectionExtensions.cs @@ -105,14 +105,16 @@ namespace Bit.Core.Utilities if(!globalSettings.SelfHosted && CoreHelpers.SettingHasValue(globalSettings.Storage.ConnectionString)) { services.AddSingleton(); - services.AddSingleton(); + //services.AddSingleton(); } else { services.AddSingleton(); - services.AddSingleton(); + //services.AddSingleton(); } + services.AddSingleton(); + if(CoreHelpers.SettingHasValue(globalSettings.Attachment.ConnectionString)) { services.AddSingleton(); @@ -136,6 +138,7 @@ namespace Bit.Core.Utilities services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); } public static IdentityBuilder AddCustomIdentityServices(