mirror of https://github.com/Sonarr/Sonarr
make model change events opt-in per repository
This commit is contained in:
parent
28b47b415f
commit
bd4856dad8
|
@ -194,10 +194,17 @@ namespace NzbDrone.Core.Datastore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected virtual void PublishModelEvent(TModel model, RepositoryAction action)
|
private void PublishModelEvent(TModel model, RepositoryAction action)
|
||||||
|
{
|
||||||
|
if (PublishModelEvents)
|
||||||
{
|
{
|
||||||
_messageAggregator.PublishEvent(new ModelEvent<TModel>(model, action));
|
_messageAggregator.PublishEvent(new ModelEvent<TModel>(model, action));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual bool PublishModelEvents
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,5 @@ namespace NzbDrone.Core.Instrumentation
|
||||||
var oldIds = Query.Where(c => c.Time < DateTime.Now.AddDays(-30).Date).Select(c => c.Id);
|
var oldIds = Query.Where(c => c.Time < DateTime.Now.AddDays(-30).Date).Select(c => c.Id);
|
||||||
DeleteMany(oldIds);
|
DeleteMany(oldIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PublishModelEvent(Log model, Datastore.Events.RepositoryAction action)
|
|
||||||
{
|
|
||||||
//Don't publish log added events.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue