[backend/api] Add admin endpoint to manually trigger media cleanup
This commit is contained in:
parent
138ac01d13
commit
1b4ba8b6a0
1 changed files with 9 additions and 0 deletions
|
@ -12,6 +12,7 @@ using Iceshrimp.Backend.Core.Federation.ActivityStreams.Types;
|
||||||
using Iceshrimp.Backend.Core.Helpers;
|
using Iceshrimp.Backend.Core.Helpers;
|
||||||
using Iceshrimp.Backend.Core.Middleware;
|
using Iceshrimp.Backend.Core.Middleware;
|
||||||
using Iceshrimp.Backend.Core.Services;
|
using Iceshrimp.Backend.Core.Services;
|
||||||
|
using Iceshrimp.Backend.Core.Tasks;
|
||||||
using Iceshrimp.Shared.Schemas.Web;
|
using Iceshrimp.Shared.Schemas.Web;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
@ -177,6 +178,14 @@ public class AdminController(
|
||||||
await relaySvc.UnsubscribeFromRelay(relay);
|
await relaySvc.UnsubscribeFromRelay(relay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost("drive/prune-expired-media")]
|
||||||
|
[ProducesResults(HttpStatusCode.OK)]
|
||||||
|
public async Task PruneExpiredMedia([FromServices] IServiceScopeFactory factory)
|
||||||
|
{
|
||||||
|
await using var scope = factory.CreateAsyncScope();
|
||||||
|
await new MediaCleanupTask().Invoke(scope.ServiceProvider);
|
||||||
|
}
|
||||||
|
|
||||||
[UseNewtonsoftJson]
|
[UseNewtonsoftJson]
|
||||||
[HttpGet("activities/notes/{id}")]
|
[HttpGet("activities/notes/{id}")]
|
||||||
[OverrideResultType<ASNote>]
|
[OverrideResultType<ASNote>]
|
||||||
|
|
Loading…
Add table
Reference in a new issue