[backend/core] Fix the (now scoped) MetaService dependency in PushService
This commit is contained in:
parent
72010f9ee2
commit
2065a73ad9
2 changed files with 2 additions and 3 deletions
|
@ -1,4 +1,3 @@
|
||||||
using EntityFramework.Exceptions.Common;
|
|
||||||
using Iceshrimp.Backend.Core.Database;
|
using Iceshrimp.Backend.Core.Database;
|
||||||
using Iceshrimp.Backend.Core.Database.Tables;
|
using Iceshrimp.Backend.Core.Database.Tables;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
|
@ -21,8 +21,7 @@ public class PushService(
|
||||||
ILogger<PushService> logger,
|
ILogger<PushService> logger,
|
||||||
IServiceScopeFactory scopeFactory,
|
IServiceScopeFactory scopeFactory,
|
||||||
HttpClient httpClient,
|
HttpClient httpClient,
|
||||||
IOptions<Config.InstanceSection> config,
|
IOptions<Config.InstanceSection> config
|
||||||
MetaService meta
|
|
||||||
) : BackgroundService
|
) : BackgroundService
|
||||||
{
|
{
|
||||||
protected override Task ExecuteAsync(CancellationToken stoppingToken)
|
protected override Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
|
@ -86,6 +85,7 @@ public class PushService(
|
||||||
if (body.Length > 137)
|
if (body.Length > 137)
|
||||||
body = body.Truncate(137).TrimEnd() + "...";
|
body = body.Truncate(137).TrimEnd() + "...";
|
||||||
|
|
||||||
|
var meta = scope.ServiceProvider.GetRequiredService<MetaService>();
|
||||||
var (priv, pub) = await meta.GetMany(MetaEntity.VapidPrivateKey, MetaEntity.VapidPublicKey);
|
var (priv, pub) = await meta.GetMany(MetaEntity.VapidPrivateKey, MetaEntity.VapidPublicKey);
|
||||||
|
|
||||||
var client = new WebPushClient(httpClient);
|
var client = new WebPushClient(httpClient);
|
||||||
|
|
Loading…
Add table
Reference in a new issue