[backend] Add [MustDisposeResource] attribute to WebSocketConnection & StreamingConnectionAggregate

This commit is contained in:
Laura Hausmann 2024-04-09 18:22:51 +02:00
parent 5c5e724fd3
commit fae324c3f3
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
3 changed files with 23 additions and 18 deletions

View file

@ -8,10 +8,12 @@ using Iceshrimp.Backend.Core.Database.Tables;
using Iceshrimp.Backend.Core.Events; using Iceshrimp.Backend.Core.Events;
using Iceshrimp.Backend.Core.Helpers; using Iceshrimp.Backend.Core.Helpers;
using Iceshrimp.Backend.Core.Services; using Iceshrimp.Backend.Core.Services;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Controllers.Mastodon.Streaming; namespace Iceshrimp.Backend.Controllers.Mastodon.Streaming;
[MustDisposeResource]
public sealed class WebSocketConnection( public sealed class WebSocketConnection(
WebSocket socket, WebSocket socket,
OauthToken token, OauthToken token,

View file

@ -9,11 +9,13 @@ using Iceshrimp.Backend.Core.Helpers;
using Iceshrimp.Backend.Core.Services; using Iceshrimp.Backend.Core.Services;
using Iceshrimp.Shared.HubSchemas; using Iceshrimp.Shared.HubSchemas;
using Iceshrimp.Shared.Schemas; using Iceshrimp.Shared.Schemas;
using JetBrains.Annotations;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Hubs.Helpers; namespace Iceshrimp.Backend.Hubs.Helpers;
[MustDisposeResource]
public sealed class StreamingConnectionAggregate : IDisposable public sealed class StreamingConnectionAggregate : IDisposable
{ {
private readonly User _user; private readonly User _user;

View file

@ -18,6 +18,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.3" />
</ItemGroup> </ItemGroup>