Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2018-05-16 18:46:18 +0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2018-05-24 21:34:43 +0300
commitbb8f2520b4254c9dabe377df48e29c5f17894a1d (patch)
tree59c0f074d6c662fd6243219e2cdfb205000e59f2 /app/workers
parentddc760a0d625706196629c061f9dfa1cd2d8402e (diff)
Persist truncated note diffs on a new table
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.yml1
-rw-r--r--app/workers/create_note_diff_file_worker.rb9
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