mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-17 15:02:34 +02:00
Order the pipeline registration process.
This commit is contained in:
parent
a2536deef0
commit
19aded7a15
@ -27,6 +27,8 @@ public EnableAuthInNancy(IAuthenticationService authenticationService,
|
||||
_configFileProvider = configFileProvider;
|
||||
}
|
||||
|
||||
public int Order { get { return 10; } }
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
if (_configFileProvider.AuthenticationMethod == AuthenticationType.Forms)
|
||||
|
@ -14,6 +14,8 @@ public CacheHeaderPipeline(ICacheableSpecification cacheableSpecification)
|
||||
_cacheableSpecification = cacheableSpecification;
|
||||
}
|
||||
|
||||
public int Order { get { return 0; } }
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
pipelines.AfterRequest.AddItemToStartOfPipeline((Action<NancyContext>) Handle);
|
||||
|
@ -7,6 +7,8 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
||||
{
|
||||
public class CorsPipeline : IRegisterNancyPipeline
|
||||
{
|
||||
public int Order { get { return 0; } }
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
pipelines.AfterRequest.AddItemToEndOfPipeline((Action<NancyContext>) Handle);
|
||||
|
@ -12,6 +12,8 @@ public class GzipCompressionPipeline : IRegisterNancyPipeline
|
||||
{
|
||||
private readonly Logger _logger;
|
||||
|
||||
public int Order { get { return 0; } }
|
||||
|
||||
public GzipCompressionPipeline(Logger logger)
|
||||
{
|
||||
_logger = logger;
|
||||
|
@ -4,6 +4,8 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
||||
{
|
||||
public interface IRegisterNancyPipeline
|
||||
{
|
||||
int Order { get; }
|
||||
|
||||
void Register(IPipelines pipelines);
|
||||
}
|
||||
}
|
@ -14,6 +14,8 @@ public IfModifiedPipeline(ICacheableSpecification cacheableSpecification)
|
||||
_cacheableSpecification = cacheableSpecification;
|
||||
}
|
||||
|
||||
public int Order { get { return 0; } }
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
pipelines.BeforeRequest.AddItemToStartOfPipeline((Func<NancyContext, Response>) Handle);
|
||||
|
@ -7,6 +7,8 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
||||
{
|
||||
public class NzbDroneVersionPipeline : IRegisterNancyPipeline
|
||||
{
|
||||
public int Order { get { return 0; } }
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
pipelines.AfterRequest.AddItemToStartOfPipeline((Action<NancyContext>) Handle);
|
||||
|
@ -14,6 +14,8 @@ public class RequestLoggingPipeline : IRegisterNancyPipeline
|
||||
|
||||
private static int _requestSequenceID;
|
||||
|
||||
public int Order { get { return 100; } }
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
pipelines.BeforeRequest.AddItemToStartOfPipeline(LogStart);
|
||||
|
@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using NLog;
|
||||
using System.Linq;
|
||||
using Nancy;
|
||||
using Nancy.Bootstrapper;
|
||||
using Nancy.Diagnostics;
|
||||
using NLog;
|
||||
using NzbDrone.Api.ErrorManagement;
|
||||
using NzbDrone.Api.Extensions.Pipelines;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
@ -43,7 +44,7 @@ protected override void ApplicationStartup(TinyIoCContainer container, IPipeline
|
||||
|
||||
private void RegisterPipelines(IPipelines pipelines)
|
||||
{
|
||||
var pipelineRegistrars = _tinyIoCContainer.ResolveAll<IRegisterNancyPipeline>();
|
||||
var pipelineRegistrars = _tinyIoCContainer.ResolveAll<IRegisterNancyPipeline>().OrderBy(v => v.Order).ToList();
|
||||
|
||||
foreach (var registerNancyPipeline in pipelineRegistrars)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user