Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
GitLab Community Edition
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
13,982
Issues
13,982
List
Boards
Labels
Service Desk
Milestones
Merge Requests
796
Merge Requests
796
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GitLab.org
GitLab Community Edition
Commits
d8dee231
Commit
d8dee231
authored
Nov 20, 2017
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove the rake task `gitlab:sidekiq:drop_post_receive`
This task is no longer being used and is not documented.
parent
9414bb00
Pipeline
#14157767
passed with stages
in 67 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
47 deletions
+0
-47
sidekiq.rake
lib/tasks/gitlab/sidekiq.rake
+0
-47
No files found.
lib/tasks/gitlab/sidekiq.rake
deleted
100644 → 0
View file @
9414bb00
namespace
:gitlab
do
namespace
:sidekiq
do
QUEUE
=
'queue:post_receive'
.
freeze
desc
'Drop all Sidekiq PostReceive jobs for a given project'
task
:drop_post_receive
,
[
:project
]
=>
:environment
do
|
t
,
args
|
unless
args
.
project
.
present?
abort
"Please specify the project you want to drop PostReceive jobs for:
\n
rake gitlab:sidekiq:drop_post_receive[group/project]"
end
project_path
=
Project
.
find_by_full_path
(
args
.
project
).
repository
.
path_to_repo
Sidekiq
.
redis
do
|
redis
|
unless
redis
.
exists
(
QUEUE
)
abort
"Queue
#{
QUEUE
}
is empty"
end
temp_queue
=
"
#{
QUEUE
}
_
#{
Time
.
now
.
to_i
}
"
redis
.
rename
(
QUEUE
,
temp_queue
)
# At this point, then post_receive queue is empty. It may be receiving
# new jobs already. We will repopulate it with the old jobs, skipping the
# ones we want to drop.
dropped
=
0
while
(
job
=
redis
.
lpop
(
temp_queue
))
if
repo_path
(
job
)
==
project_path
dropped
+=
1
else
redis
.
rpush
(
QUEUE
,
job
)
end
end
# The temp_queue will delete itself after we have popped all elements
# from it
puts
"Dropped
#{
dropped
}
jobs containing
#{
project_path
}
from
#{
QUEUE
}
"
end
end
def
repo_path
(
job
)
job_args
=
JSON
.
parse
(
job
)[
'args'
]
if
job_args
job_args
.
first
else
nil
end
end
end
end
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