MM-49354: Make compliance export query cancellable (#21943)
We accept a context that can cancel the query. This allows us to exit a job faster. ```release-note Compliance export job can now cancel the SQL query execution during server shutdown which will allow the job to exit faster. ``` Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
40cd6b1656
Коммит
1e02b99bf1
@@ -2932,10 +2932,10 @@ func (s *TimerLayerComplianceStore) GetAll(offset int, limit int) (model.Complia
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerComplianceStore) MessageExport(cursor model.MessageExportCursor, limit int) ([]*model.MessageExport, model.MessageExportCursor, error) {
|
||||
func (s *TimerLayerComplianceStore) MessageExport(ctx context.Context, cursor model.MessageExportCursor, limit int) ([]*model.MessageExport, model.MessageExportCursor, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, resultVar1, err := s.ComplianceStore.MessageExport(cursor, limit)
|
||||
result, resultVar1, err := s.ComplianceStore.MessageExport(ctx, cursor, limit)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user