refactor(archival): ♻ 'hope' that multiple jobs don't conflict between git stage and commit

This commit is contained in:
Collin M. Barrett 2020-09-19 12:39:55 -05:00
parent 09f35b2922
commit b1ba4dfb3d
2 changed files with 2 additions and 3 deletions

View file

@ -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);

View file

@ -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});
}
}
}