|
|
|
@ -2,21 +2,19 @@ using Recyclarr.Cli.Console.Settings;
|
|
|
|
|
using Recyclarr.Cli.Pipelines;
|
|
|
|
|
using Recyclarr.Compatibility;
|
|
|
|
|
using Recyclarr.Config.Models;
|
|
|
|
|
using Spectre.Console;
|
|
|
|
|
|
|
|
|
|
namespace Recyclarr.Cli.Processors.Sync;
|
|
|
|
|
|
|
|
|
|
public class SyncPipelineExecutor(
|
|
|
|
|
public class CompositeSyncPipeline(
|
|
|
|
|
ILogger log,
|
|
|
|
|
IAnsiConsole console,
|
|
|
|
|
IOrderedEnumerable<ISyncPipeline> pipelines,
|
|
|
|
|
IEnumerable<IPipelineCache> caches,
|
|
|
|
|
ServiceAgnosticCapabilityEnforcer enforcer,
|
|
|
|
|
IServiceConfiguration config)
|
|
|
|
|
IServiceConfiguration config) : ISyncPipeline
|
|
|
|
|
{
|
|
|
|
|
public async Task Process(ISyncSettings settings, CancellationToken ct)
|
|
|
|
|
public virtual async Task Execute(ISyncSettings settings, CancellationToken ct)
|
|
|
|
|
{
|
|
|
|
|
PrintProcessingHeader();
|
|
|
|
|
log.Debug("Processing {Server} server {Name}", config.ServiceType, config.InstanceName);
|
|
|
|
|
|
|
|
|
|
await enforcer.Check(config, ct);
|
|
|
|
|
|
|
|
|
@ -32,20 +30,4 @@ public class SyncPipelineExecutor(
|
|
|
|
|
|
|
|
|
|
log.Information("Completed at {Date}", DateTime.Now);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PrintProcessingHeader()
|
|
|
|
|
{
|
|
|
|
|
var instanceName = config.InstanceName;
|
|
|
|
|
|
|
|
|
|
console.WriteLine(
|
|
|
|
|
$"""
|
|
|
|
|
|
|
|
|
|
===========================================
|
|
|
|
|
Processing {config.ServiceType} Server: [{instanceName}]
|
|
|
|
|
===========================================
|
|
|
|
|
|
|
|
|
|
""");
|
|
|
|
|
|
|
|
|
|
log.Debug("Processing {Server} server {Name}", config.ServiceType, instanceName);
|
|
|
|
|
}
|
|
|
|
|
}
|