Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
b3c8ffe6
Commit
b3c8ffe6
authored
May 02, 2017
by
Alejandro Rodríguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup use of gl-repository to enqueue PostReceive sidekiq jobs
parent
ee259653
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
lib/gitlab_net.rb
lib/gitlab_net.rb
+0
-1
lib/gitlab_post_receive.rb
lib/gitlab_post_receive.rb
+4
-1
No files found.
lib/gitlab_net.rb
View file @
b3c8ffe6
...
@@ -27,7 +27,6 @@ class GitlabNet
...
@@ -27,7 +27,6 @@ class GitlabNet
env:
env
env:
env
}
}
if
actor
=~
/\Akey\-\d+\Z/
if
actor
=~
/\Akey\-\d+\Z/
params
.
merge!
(
key_id:
actor
.
gsub
(
"key-"
,
""
))
params
.
merge!
(
key_id:
actor
.
gsub
(
"key-"
,
""
))
elsif
actor
=~
/\Auser\-\d+\Z/
elsif
actor
=~
/\Auser\-\d+\Z/
...
...
lib/gitlab_post_receive.rb
View file @
b3c8ffe6
...
@@ -107,11 +107,14 @@ class GitlabPostReceive
...
@@ -107,11 +107,14 @@ class GitlabPostReceive
def
update_redis
def
update_redis
# Encode changes as base64 so we don't run into trouble with non-UTF-8 input.
# Encode changes as base64 so we don't run into trouble with non-UTF-8 input.
changes
=
Base64
.
encode64
(
@changes
)
changes
=
Base64
.
encode64
(
@changes
)
# TODO: Change to `@gl_repository || @repo_path` in next release.
# See https://gitlab.com/gitlab-org/gitlab-shell/merge_requests/130#note_28747613
project_identifier
=
@repo_path
queue
=
"
#{
config
.
redis_namespace
}
:queue:post_receive"
queue
=
"
#{
config
.
redis_namespace
}
:queue:post_receive"
msg
=
JSON
.
dump
({
msg
=
JSON
.
dump
({
'class'
=>
'PostReceive'
,
'class'
=>
'PostReceive'
,
'args'
=>
[
@repo_path
,
@actor
,
changes
],
'args'
=>
[
project_identifier
,
@actor
,
changes
],
'jid'
=>
@jid
,
'jid'
=>
@jid
,
'enqueued_at'
=>
Time
.
now
.
to_f
'enqueued_at'
=>
Time
.
now
.
to_f
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment