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.Common\BirdsiteLive.Common.csproj" />
|
||||||
<ProjectReference Include="..\BirdsiteLive.Cryptography\BirdsiteLive.Cryptography.csproj" />
|
<ProjectReference Include="..\BirdsiteLive.Cryptography\BirdsiteLive.Cryptography.csproj" />
|
||||||
<ProjectReference Include="..\BirdsiteLive.Domain\BirdsiteLive.Domain.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.Pipeline\BirdsiteLive.Pipeline.csproj" />
|
||||||
<ProjectReference Include="..\BirdsiteLive.Twitter\BirdsiteLive.Twitter.csproj" />
|
<ProjectReference Include="..\BirdsiteLive.Twitter\BirdsiteLive.Twitter.csproj" />
|
||||||
<ProjectReference Include="..\DataAccessLayers\BirdsiteLive.DAL.Postgres\BirdsiteLive.DAL.Postgres.csproj" />
|
<ProjectReference Include="..\DataAccessLayers\BirdsiteLive.DAL.Postgres\BirdsiteLive.DAL.Postgres.csproj" />
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using BirdsiteLive.DAL;
|
using BirdsiteLive.DAL;
|
||||||
using BirdsiteLive.DAL.Contracts;
|
using BirdsiteLive.DAL.Contracts;
|
||||||
|
using BirdsiteLive.Moderation;
|
||||||
using BirdsiteLive.Pipeline;
|
using BirdsiteLive.Pipeline;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
|
@ -12,12 +13,14 @@ namespace BirdsiteLive.Services
|
||||||
public class FederationService : BackgroundService
|
public class FederationService : BackgroundService
|
||||||
{
|
{
|
||||||
private readonly IDatabaseInitializer _databaseInitializer;
|
private readonly IDatabaseInitializer _databaseInitializer;
|
||||||
|
private readonly IModerationPipeline _moderationPipeline;
|
||||||
private readonly IStatusPublicationPipeline _statusPublicationPipeline;
|
private readonly IStatusPublicationPipeline _statusPublicationPipeline;
|
||||||
|
|
||||||
#region Ctor
|
#region Ctor
|
||||||
public FederationService(IDatabaseInitializer databaseInitializer, IStatusPublicationPipeline statusPublicationPipeline)
|
public FederationService(IDatabaseInitializer databaseInitializer, IModerationPipeline moderationPipeline, IStatusPublicationPipeline statusPublicationPipeline)
|
||||||
{
|
{
|
||||||
_databaseInitializer = databaseInitializer;
|
_databaseInitializer = databaseInitializer;
|
||||||
|
_moderationPipeline = moderationPipeline;
|
||||||
_statusPublicationPipeline = statusPublicationPipeline;
|
_statusPublicationPipeline = statusPublicationPipeline;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -25,6 +28,7 @@ namespace BirdsiteLive.Services
|
||||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
{
|
{
|
||||||
await _databaseInitializer.InitAndMigrateDbAsync();
|
await _databaseInitializer.InitAndMigrateDbAsync();
|
||||||
|
await _moderationPipeline.ApplyModerationSettingsAsync();
|
||||||
await _statusPublicationPipeline.ExecuteAsync(stoppingToken);
|
await _statusPublicationPipeline.ExecuteAsync(stoppingToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue