summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-08-02 14:22:18 -0700
committerStan Hu <stanhu@gmail.com>2018-08-02 16:06:17 -0700
commit3fda119ea35a76bc07accfdacee55cb5b6c880cf (patch)
tree0eae820f211f860a223e6a6d4fd9543375f0a8b7 /app/workers
parent93c7b6c51a49a1939a876f2510a69e59827ac816 (diff)
downloadgitlab-ce-3fda119ea35a76bc07accfdacee55cb5b6c880cf.tar.gz
Make CreateGpgSignatureWorker backwards compatible with original method signature
Older versions of GitPushService push a single commit SHA string to the queue, but Gitaly requires that the parameters sent by CreateGpgSignatureWorker are an array. It's possible to have old workers using this original signature or jobs in the retry queue that would fail if CreateGpgSignatureWorker can't handle the string form.
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/create_gpg_signature_worker.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/workers/create_gpg_signature_worker.rb b/app/workers/create_gpg_signature_worker.rb
index 91833941070..a1aeeb7c4fc 100644
--- a/app/workers/create_gpg_signature_worker.rb
+++ b/app/workers/create_gpg_signature_worker.rb
@@ -4,6 +4,10 @@ class CreateGpgSignatureWorker
include ApplicationWorker
def perform(commit_shas, project_id)
+ # Older versions of GitPushService may push a single commit ID on the stack.
+ # We need this to be backwards compatible.
+ commit_shas = Array(commit_shas)
+
return if commit_shas.empty?
project = Project.find_by(id: project_id)