1
0
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:
Kyle Spearrin 2019-02-03 22:39:53 -05:00
parent 7675478daa
commit 22c049c9c5
3 changed files with 13 additions and 0 deletions

View File

@ -22,6 +22,7 @@ namespace Bit.Admin.Jobs
protected async override Task ExecuteJobAsync(IJobExecutionContext context)
{
await _maintenanceRepository.UpdateStatisticsAsync();
await _maintenanceRepository.DisableCipherAutoStatsAsync();
}
}
}

View File

@ -5,6 +5,7 @@ namespace Bit.Core.Repositories
public interface IMaintenanceRepository
{
Task UpdateStatisticsAsync();
Task DisableCipherAutoStatsAsync();
Task RebuildIndexesAsync();
Task DeleteExpiredGrantsAsync();
}

View File

@ -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))