From b1ba4dfb3d05d2f1c7e00a1a8545bf95b215c841 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 19 Sep 2020 12:39:55 -0500 Subject: [PATCH] =?UTF-8?q?refactor(archival):=20=E2=99=BB=20'hope'=20that?= =?UTF-8?q?=20multiple=20jobs=20don't=20conflict=20between=20git=20stage?= =?UTF-8?q?=20and=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Persistence/GitFileArchiver.cs | 2 +- .../Scheduling/ConfigurationExtensions.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitFileArchiver.cs b/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitFileArchiver.cs index f61d1a3b1..219099b9a 100644 --- a/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitFileArchiver.cs +++ b/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitFileArchiver.cs @@ -68,9 +68,9 @@ public async Task ArchiveFileAsync( public void Commit() { var fileNames = _writtenFiles.Select(f => f.Name).ToList(); - Commands.Stage(_repo, fileNames); var signature = new Signature(_options.UserName, _options.UserEmail, DateTime.UtcNow); var message = $"feat(archives): archive {fileNames.Count} files{Environment.NewLine}{string.Join(Environment.NewLine, fileNames)}"; + Commands.Stage(_repo, fileNames); _repo.Commit(message, signature, signature); _logger.LogDebug("Committed {@FileNames}", fileNames); diff --git a/services/Archival/FilterLists.Archival.Infrastructure/Scheduling/ConfigurationExtensions.cs b/services/Archival/FilterLists.Archival.Infrastructure/Scheduling/ConfigurationExtensions.cs index 4c1f554d9..961bde835 100644 --- a/services/Archival/FilterLists.Archival.Infrastructure/Scheduling/ConfigurationExtensions.cs +++ b/services/Archival/FilterLists.Archival.Infrastructure/Scheduling/ConfigurationExtensions.cs @@ -24,8 +24,7 @@ public static void AddSchedulingServices(this IServiceCollection services, IConf public static void UseScheduling(this IApplicationBuilder app) { - // TODO: re-evaluate git in parallel - app.UseHangfireServer(new BackgroundJobServerOptions {WorkerCount = 1}); + app.UseHangfireServer(new BackgroundJobServerOptions {WorkerCount = Environment.ProcessorCount}); } } }