V13-FE-011: finalize search list layout slice
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using Dapper;
|
||||
using Npgsql;
|
||||
|
||||
namespace Shared.Excel;
|
||||
|
||||
/// <summary>
|
||||
/// Run daily from Hangfire. The default reference retention is 14 days.
|
||||
/// Audit/domain records survive; raw uploaded files and staging rows do not.
|
||||
/// </summary>
|
||||
public sealed class PurgeExpiredImportsJob(NpgsqlDataSource dataSource)
|
||||
{
|
||||
public async Task<int> RunAsync(CancellationToken ct)
|
||||
{
|
||||
await using var connection = await dataSource.OpenConnectionAsync(ct);
|
||||
return await connection.ExecuteAsync(new CommandDefinition("""
|
||||
delete from kbx.import_sessions
|
||||
where expires_at < now()
|
||||
and status in ('completed','partially-completed','failed','cancelled');
|
||||
""", cancellationToken: ct));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user