From 2065a73ad97c6fc28cac919ac6b1dac06ee57598 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sun, 24 Mar 2024 16:33:03 +0100 Subject: [PATCH] [backend/core] Fix the (now scoped) MetaService dependency in PushService --- Iceshrimp.Backend/Core/Services/MetaService.cs | 1 - Iceshrimp.Backend/Core/Services/PushService.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Iceshrimp.Backend/Core/Services/MetaService.cs b/Iceshrimp.Backend/Core/Services/MetaService.cs index b8e15132..ebe0129d 100644 --- a/Iceshrimp.Backend/Core/Services/MetaService.cs +++ b/Iceshrimp.Backend/Core/Services/MetaService.cs @@ -1,4 +1,3 @@ -using EntityFramework.Exceptions.Common; using Iceshrimp.Backend.Core.Database; using Iceshrimp.Backend.Core.Database.Tables; using Microsoft.EntityFrameworkCore; diff --git a/Iceshrimp.Backend/Core/Services/PushService.cs b/Iceshrimp.Backend/Core/Services/PushService.cs index 5e9ca378..20ce6a85 100644 --- a/Iceshrimp.Backend/Core/Services/PushService.cs +++ b/Iceshrimp.Backend/Core/Services/PushService.cs @@ -21,8 +21,7 @@ public class PushService( ILogger logger, IServiceScopeFactory scopeFactory, HttpClient httpClient, - IOptions config, - MetaService meta + IOptions config ) : BackgroundService { protected override Task ExecuteAsync(CancellationToken stoppingToken) @@ -86,6 +85,7 @@ public class PushService( if (body.Length > 137) body = body.Truncate(137).TrimEnd() + "..."; + var meta = scope.ServiceProvider.GetRequiredService(); var (priv, pub) = await meta.GetMany(MetaEntity.VapidPrivateKey, MetaEntity.VapidPublicKey); var client = new WebPushClient(httpClient);