diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-05-16 12:46:18 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-05-24 15:34:43 -0300 |
commit | bb8f2520b4254c9dabe377df48e29c5f17894a1d (patch) | |
tree | 59c0f074d6c662fd6243219e2cdfb205000e59f2 /app/workers | |
parent | ddc760a0d625706196629c061f9dfa1cd2d8402e (diff) | |
download | gitlab-ce-45190-create-notes-diff-files.tar.gz |
Persist truncated note diffs on a new table45190-create-notes-diff-files
We request Gitaly in a N+1 manner to build discussion diffs. Once the diffs are from different revisions, it's hard to make a single request to the service in order to build the whole response.
With this change we solve this problem and simplify a lot fetching this piece of info.
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/all_queues.yml | 1 | ||||
-rw-r--r-- | app/workers/create_note_diff_file_worker.rb | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index b6433eb3eff..d07865a4043 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -115,3 +115,4 @@ - upload_checksum - web_hook - repository_update_remote_mirror +- create_note_diff_file diff --git a/app/workers/create_note_diff_file_worker.rb b/app/workers/create_note_diff_file_worker.rb new file mode 100644 index 00000000000..624b638a24e --- /dev/null +++ b/app/workers/create_note_diff_file_worker.rb @@ -0,0 +1,9 @@ +class CreateNoteDiffFileWorker + include ApplicationWorker + + def perform(diff_note_id) + diff_note = DiffNote.find(diff_note_id) + + diff_note.create_diff_file + end +end |