mirror of
https://github.com/bitwarden/server.git
synced 2025-05-03 02:32:16 -05: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)
|
protected async override Task ExecuteJobAsync(IJobExecutionContext context)
|
||||||
{
|
{
|
||||||
await _maintenanceRepository.UpdateStatisticsAsync();
|
await _maintenanceRepository.UpdateStatisticsAsync();
|
||||||
|
await _maintenanceRepository.DisableCipherAutoStatsAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ namespace Bit.Core.Repositories
|
|||||||
public interface IMaintenanceRepository
|
public interface IMaintenanceRepository
|
||||||
{
|
{
|
||||||
Task UpdateStatisticsAsync();
|
Task UpdateStatisticsAsync();
|
||||||
|
Task DisableCipherAutoStatsAsync();
|
||||||
Task RebuildIndexesAsync();
|
Task RebuildIndexesAsync();
|
||||||
Task DeleteExpiredGrantsAsync();
|
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()
|
public async Task RebuildIndexesAsync()
|
||||||
{
|
{
|
||||||
using(var connection = new SqlConnection(ConnectionString))
|
using(var connection = new SqlConnection(ConnectionString))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user