BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
352ab2fa
Commit
352ab2fa
authored
Oct 24, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sh-fix-mailroom-config' into 'master'
Fix reply-by-email not working due to queue name mismatch See merge request !7068
parents
501bd94d
59ed1d3c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
2 deletions
+66
-2
CHANGELOG.md
CHANGELOG.md
+1
-0
mail_room.yml
config/mail_room.yml
+1
-1
20161024042317_migrate_mailroom_queue_from_default.rb
...ate/20161024042317_migrate_mailroom_queue_from_default.rb
+63
-0
schema.rb
db/schema.rb
+1
-1
No files found.
CHANGELOG.md
View file @
352ab2fa
...
...
@@ -13,6 +13,7 @@ Please view this file on the master branch, on stable branches it's out of date.
## 8.13.1 (unreleased)
-
Fix error in generating labels
-
Fix reply-by-email not working due to queue name mismatch
## 8.13.0 (2016-10-22)
-
Removes extra line for empty issue description. (!7045)
...
...
config/mail_room.yml
View file @
352ab2fa
...
...
@@ -25,7 +25,7 @@
:delivery_options
:
:redis_url
:
<%= config[:redis_url].to_json %>
:namespace
:
<%= Gitlab::Redis::SIDEKIQ_NAMESPACE %>
:queue
:
incoming_email
:queue
:
email_receiver
:worker
:
EmailReceiverWorker
:arbitration_method
:
redis
...
...
db/migrate/20161024042317_migrate_mailroom_queue_from_default.rb
0 → 100644
View file @
352ab2fa
require
'json'
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
MigrateMailroomQueueFromDefault
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME_REASON
=
<<-
EOF
Moving Sidekiq jobs from queues requires Sidekiq to be stopped. Not stopping
Sidekiq will result in the loss of jobs that are scheduled after this
migration completes.
EOF
disable_ddl_transaction!
# Jobs for which the queue names have been changed (e.g. multiple workers
# using the same non-default queue).
#
# The keys are the old queue names, the values the jobs to move and their new
# queue names.
RENAMED_QUEUES
=
{
incoming_email:
{
'EmailReceiverWorker'
=>
:email_receiver
}
}
def
up
Sidekiq
.
redis
do
|
redis
|
RENAMED_QUEUES
.
each
do
|
queue
,
jobs
|
migrate_from_queue
(
redis
,
queue
,
jobs
)
end
end
end
def
down
Sidekiq
.
redis
do
|
redis
|
RENAMED_QUEUES
.
each
do
|
dest_queue
,
jobs
|
jobs
.
each
do
|
worker
,
from_queue
|
migrate_from_queue
(
redis
,
from_queue
,
worker
=>
dest_queue
)
end
end
end
end
def
migrate_from_queue
(
redis
,
queue
,
job_mapping
)
while
job
=
redis
.
lpop
(
"queue:
#{
queue
}
"
)
payload
=
JSON
.
load
(
job
)
new_queue
=
job_mapping
[
payload
[
'class'
]]
# If we have no target queue to migrate to we're probably dealing with
# some ancient job for which the worker no longer exists. In that case
# there's no sane option we can take, other than just dropping the job.
next
unless
new_queue
payload
[
'queue'
]
=
new_queue
redis
.
lpush
(
"queue:
#{
new_queue
}
"
,
JSON
.
dump
(
payload
))
end
end
end
db/schema.rb
View file @
352ab2fa
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201610
19213545
)
do
ActiveRecord
::
Schema
.
define
(
version:
201610
24042317
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
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