wirering moderation pipeline to service-worker
This commit is contained in:
parent
9920316863
commit
39419fd50c
2 changed files with 6 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
|||
<ProjectReference Include="..\BirdsiteLive.Common\BirdsiteLive.Common.csproj" />
|
||||
<ProjectReference Include="..\BirdsiteLive.Cryptography\BirdsiteLive.Cryptography.csproj" />
|
||||
<ProjectReference Include="..\BirdsiteLive.Domain\BirdsiteLive.Domain.csproj" />
|
||||
<ProjectReference Include="..\BirdsiteLive.Moderation\BirdsiteLive.Moderation.csproj" />
|
||||
<ProjectReference Include="..\BirdsiteLive.Pipeline\BirdsiteLive.Pipeline.csproj" />
|
||||
<ProjectReference Include="..\BirdsiteLive.Twitter\BirdsiteLive.Twitter.csproj" />
|
||||
<ProjectReference Include="..\DataAccessLayers\BirdsiteLive.DAL.Postgres\BirdsiteLive.DAL.Postgres.csproj" />
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using BirdsiteLive.DAL;
|
||||
using BirdsiteLive.DAL.Contracts;
|
||||
using BirdsiteLive.Moderation;
|
||||
using BirdsiteLive.Pipeline;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
|
@ -12,12 +13,14 @@ namespace BirdsiteLive.Services
|
|||
public class FederationService : BackgroundService
|
||||
{
|
||||
private readonly IDatabaseInitializer _databaseInitializer;
|
||||
private readonly IModerationPipeline _moderationPipeline;
|
||||
private readonly IStatusPublicationPipeline _statusPublicationPipeline;
|
||||
|
||||
#region Ctor
|
||||
public FederationService(IDatabaseInitializer databaseInitializer, IStatusPublicationPipeline statusPublicationPipeline)
|
||||
public FederationService(IDatabaseInitializer databaseInitializer, IModerationPipeline moderationPipeline, IStatusPublicationPipeline statusPublicationPipeline)
|
||||
{
|
||||
_databaseInitializer = databaseInitializer;
|
||||
_moderationPipeline = moderationPipeline;
|
||||
_statusPublicationPipeline = statusPublicationPipeline;
|
||||
}
|
||||
#endregion
|
||||
|
@ -25,6 +28,7 @@ namespace BirdsiteLive.Services
|
|||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
await _databaseInitializer.InitAndMigrateDbAsync();
|
||||
await _moderationPipeline.ApplyModerationSettingsAsync();
|
||||
await _statusPublicationPipeline.ExecuteAsync(stoppingToken);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue