diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-24 15:13:46 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-24 15:13:46 +0200 |
commit | 12711de2564e1aecbd68f926e28d0d3e2241da41 (patch) | |
tree | 1e00d5561d09ab0700c6d1b41e88d348a0d64c1b /lib | |
parent | 4887b1b76a9722926b1c82eceba409e2f7d2d7da (diff) | |
download | gitlab-ce-12711de2564e1aecbd68f926e28d0d3e2241da41.tar.gz |
Implement efficient destroy of job_trace_chunks
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/trace.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/trace/chunked_io.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/ci/trace.rb b/lib/gitlab/ci/trace.rb index af86b47adb8..963f0228c1a 100644 --- a/lib/gitlab/ci/trace.rb +++ b/lib/gitlab/ci/trace.rb @@ -100,7 +100,7 @@ module Gitlab FileUtils.rm(trace_path, force: true) end - job.chunks.delete_all + job.chunks.fast_destroy_all job.erase_old_trace! end diff --git a/lib/gitlab/ci/trace/chunked_io.rb b/lib/gitlab/ci/trace/chunked_io.rb index 7661c194a40..9d4243d152a 100644 --- a/lib/gitlab/ci/trace/chunked_io.rb +++ b/lib/gitlab/ci/trace/chunked_io.rb @@ -140,7 +140,7 @@ module Gitlab @size = offset # remove all next chunks - job_chunks.where('chunk_index > ?', chunk_index).delete_all + job_chunks.where('chunk_index > ?', chunk_index).fast_destroy_all # truncate current chunk current_chunk.truncate(chunk_offset) if chunk_offset != 0 @@ -156,8 +156,8 @@ module Gitlab true end - def delete! - job_chunks.delete_all + def destroy! + job_chunks.fast_destroy_all @tell = @size = 0 ensure invalidate_chunk_cache |