mirror of
https://github.com/bitwarden/server.git
synced 2025-02-02 23:41:21 +01:00
disable autostats for cipher table
This commit is contained in:
parent
7675478daa
commit
22c049c9c5
@ -22,6 +22,7 @@ namespace Bit.Admin.Jobs
|
||||
protected async override Task ExecuteJobAsync(IJobExecutionContext context)
|
||||
{
|
||||
await _maintenanceRepository.UpdateStatisticsAsync();
|
||||
await _maintenanceRepository.DisableCipherAutoStatsAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ namespace Bit.Core.Repositories
|
||||
public interface IMaintenanceRepository
|
||||
{
|
||||
Task UpdateStatisticsAsync();
|
||||
Task DisableCipherAutoStatsAsync();
|
||||
Task RebuildIndexesAsync();
|
||||
Task DeleteExpiredGrantsAsync();
|
||||
}
|
||||
|
@ -27,6 +27,17 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DisableCipherAutoStatsAsync()
|
||||
{
|
||||
using(var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
await connection.ExecuteAsync(
|
||||
"sp_autostats",
|
||||
new { tblname = "[dbo].[Cipher]", flagc = "OFF" },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RebuildIndexesAsync()
|
||||
{
|
||||
using(var connection = new SqlConnection(ConnectionString))
|
||||
|
Loading…
Reference in New Issue
Block a user