1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-05 01:52:49 -05:00

Run formatting (#2230)

This commit is contained in:
Justin Baur
2022-08-29 16:06:55 -04:00
committed by GitHub
parent 9b7aef0763
commit 7f5f010e1e
1205 changed files with 73813 additions and 75022 deletions

View File

@ -2,53 +2,52 @@
using Bit.Core.Repositories;
using Microsoft.Extensions.DependencyInjection;
namespace Bit.Infrastructure.EntityFramework.Repositories
namespace Bit.Infrastructure.EntityFramework.Repositories;
public class MaintenanceRepository : BaseEntityFrameworkRepository, IMaintenanceRepository
{
public class MaintenanceRepository : BaseEntityFrameworkRepository, IMaintenanceRepository
public MaintenanceRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper)
: base(serviceScopeFactory, mapper)
{ }
public async Task DeleteExpiredGrantsAsync()
{
public MaintenanceRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper)
: base(serviceScopeFactory, mapper)
{ }
public async Task DeleteExpiredGrantsAsync()
using (var scope = ServiceScopeFactory.CreateScope())
{
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var query = from g in dbContext.Grants
where g.ExpirationDate < DateTime.UtcNow
select g;
dbContext.RemoveRange(query);
await dbContext.SaveChangesAsync();
}
}
public async Task DeleteExpiredSponsorshipsAsync(DateTime validUntilBeforeDate)
{
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var query = from s in dbContext.OrganizationSponsorships
where s.ValidUntil < validUntilBeforeDate
select s;
dbContext.RemoveRange(query);
await dbContext.SaveChangesAsync();
}
}
public Task DisableCipherAutoStatsAsync()
{
return Task.CompletedTask;
}
public Task RebuildIndexesAsync()
{
return Task.CompletedTask;
}
public Task UpdateStatisticsAsync()
{
return Task.CompletedTask;
var dbContext = GetDatabaseContext(scope);
var query = from g in dbContext.Grants
where g.ExpirationDate < DateTime.UtcNow
select g;
dbContext.RemoveRange(query);
await dbContext.SaveChangesAsync();
}
}
public async Task DeleteExpiredSponsorshipsAsync(DateTime validUntilBeforeDate)
{
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var query = from s in dbContext.OrganizationSponsorships
where s.ValidUntil < validUntilBeforeDate
select s;
dbContext.RemoveRange(query);
await dbContext.SaveChangesAsync();
}
}
public Task DisableCipherAutoStatsAsync()
{
return Task.CompletedTask;
}
public Task RebuildIndexesAsync()
{
return Task.CompletedTask;
}
public Task UpdateStatisticsAsync()
{
return Task.CompletedTask;
}
}