Fixed: Provider health checks persist after add until next scheduled check
This commit is contained in:
parent
62b948b24c
commit
202449c40c
|
@ -6,6 +6,7 @@ using NzbDrone.Core.ThingiProvider.Events;
|
|||
|
||||
namespace NzbDrone.Core.HealthCheck.Checks
|
||||
{
|
||||
[CheckOn(typeof(ProviderAddedEvent<IDownloadClient>))]
|
||||
[CheckOn(typeof(ProviderUpdatedEvent<IDownloadClient>))]
|
||||
[CheckOn(typeof(ProviderDeletedEvent<IDownloadClient>))]
|
||||
[CheckOn(typeof(ProviderStatusChangedEvent<IDownloadClient>))]
|
||||
|
|
|
@ -4,6 +4,7 @@ using NzbDrone.Core.ThingiProvider.Events;
|
|||
|
||||
namespace NzbDrone.Core.HealthCheck.Checks
|
||||
{
|
||||
[CheckOn(typeof(ProviderAddedEvent<IIndexer>))]
|
||||
[CheckOn(typeof(ProviderUpdatedEvent<IIndexer>))]
|
||||
[CheckOn(typeof(ProviderDeletedEvent<IIndexer>))]
|
||||
[CheckOn(typeof(ProviderStatusChangedEvent<IIndexer>))]
|
||||
|
|
|
@ -4,6 +4,7 @@ using NzbDrone.Core.ThingiProvider.Events;
|
|||
|
||||
namespace NzbDrone.Core.HealthCheck.Checks
|
||||
{
|
||||
[CheckOn(typeof(ProviderAddedEvent<IIndexer>))]
|
||||
[CheckOn(typeof(ProviderUpdatedEvent<IIndexer>))]
|
||||
[CheckOn(typeof(ProviderDeletedEvent<IIndexer>))]
|
||||
[CheckOn(typeof(ProviderStatusChangedEvent<IIndexer>))]
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
using NzbDrone.Common.Messaging;
|
||||
|
||||
namespace NzbDrone.Core.ThingiProvider.Events
|
||||
{
|
||||
public class ProviderAddedEvent<TProvider> : IEvent
|
||||
{
|
||||
public ProviderDefinition Definition { get; private set; }
|
||||
|
||||
public ProviderAddedEvent(ProviderDefinition definition)
|
||||
{
|
||||
Definition = definition;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -109,7 +109,7 @@ namespace NzbDrone.Core.ThingiProvider
|
|||
public virtual TProviderDefinition Create(TProviderDefinition definition)
|
||||
{
|
||||
var result = _providerRepository.Insert(definition);
|
||||
_eventAggregator.PublishEvent(new ProviderUpdatedEvent<TProvider>(result));
|
||||
_eventAggregator.PublishEvent(new ProviderAddedEvent<TProvider>(result));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue