Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
Boxiang Sun
gitlab-ce
Commits
496870dd
Commit
496870dd
authored
Dec 03, 2015
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate from Sidetiq to Sidekiq-cron
Updated Sidekiq to 3.5.x
parent
95fd7983
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
21 deletions
+49
-21
Gemfile
Gemfile
+2
-2
Gemfile.lock
Gemfile.lock
+30
-16
app/workers/stuck_ci_builds_worker.rb
app/workers/stuck_ci_builds_worker.rb
+0
-3
config/initializers/sidekiq.rb
config/initializers/sidekiq.rb
+6
-0
config/routes.rb
config/routes.rb
+1
-0
config/schedule.yml
config/schedule.yml
+10
-0
No files found.
Gemfile
View file @
496870dd
...
...
@@ -120,8 +120,8 @@ gem 'acts-as-taggable-on', '~> 3.4'
# Background jobs
gem
'
sinatra
'
,
'~> 1.4.4'
,
require:
nil
gem
'
sidekiq
'
,
'
3.3
.0'
gem
'
side
tiq
'
,
'~> 0.6.3
'
gem
'
sidekiq
'
,
'
~> 3.5
.0'
gem
'
side
kiq-cron
'
,
'~> 0.3.0
'
# HTTP requests
gem
"
httparty
"
,
'~> 0.13.3'
...
...
Gemfile.lock
View file @
496870dd
...
...
@@ -116,8 +116,23 @@ GEM
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
json (>= 1.7)
celluloid (0.16.0)
timers (~> 4.0.0)
celluloid (0.17.2)
celluloid-essentials
celluloid-extras
celluloid-fsm
celluloid-pool
celluloid-supervision
timers (>= 4.1.1)
celluloid-essentials (0.20.5)
timers (>= 4.1.1)
celluloid-extras (0.20.5)
timers (>= 4.1.1)
celluloid-fsm (0.20.5)
timers (>= 4.1.1)
celluloid-pool (0.20.5)
timers (>= 4.1.1)
celluloid-supervision (0.20.5)
timers (>= 4.1.1)
charlock_holmes (0.7.3)
chunky_png (1.3.5)
cliver (0.3.2)
...
...
@@ -369,7 +384,6 @@ GEM
multi_xml (>= 0.5.2)
httpclient (2.7.0.1)
i18n (0.7.0)
ice_cube (0.11.1)
ice_nine (0.11.1)
inflecto (0.0.2)
ipaddress (0.8.0)
...
...
@@ -640,6 +654,7 @@ GEM
sexp_processor (~> 4.1)
rubyntlm (0.5.2)
rubypants (0.2.0)
rufus-scheduler (3.1.10)
rugged (0.23.3)
safe_yaml (1.0.4)
sanitize (2.1.0)
...
...
@@ -667,16 +682,15 @@ GEM
rack
shoulda-matchers (2.8.0)
activesupport (>= 3.0.0)
sidekiq (3.3.0)
celluloid (>= 0.16.0)
connection_pool (>= 2.0.0)
json
redis (>= 3.0.6)
redis-namespace (>= 1.3.1)
sidetiq (0.6.3)
celluloid (>= 0.14.1)
ice_cube (= 0.11.1)
sidekiq (>= 3.0.0)
sidekiq (3.5.3)
celluloid (~> 0.17.2)
connection_pool (~> 2.2, >= 2.2.0)
json (~> 1.0)
redis (~> 3.2, >= 3.2.1)
redis-namespace (~> 1.5, >= 1.5.2)
sidekiq-cron (0.3.1)
rufus-scheduler (>= 2.0.24)
sidekiq (>= 2.17.3)
simple_oauth (0.1.9)
simplecov (0.10.0)
docile (~> 1.1.0)
...
...
@@ -742,7 +756,7 @@ GEM
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
timers (4.
0.4
)
timers (4.
1.1
)
hitimes
timfel-krb5-auth (0.8.3)
tinder (1.10.1)
...
...
@@ -936,8 +950,8 @@ DEPENDENCIES
settingslogic (~> 2.0.9)
sham_rack
shoulda-matchers (~> 2.8.0)
sidekiq (
= 3.3
.0)
side
tiq (~> 0.6.3
)
sidekiq (
~> 3.5
.0)
side
kiq-cron (~> 0.3.0
)
simplecov (~> 0.10.0)
sinatra (~> 1.4.4)
six (~> 0.2.0)
...
...
app/workers/stuck_ci_builds_worker.rb
View file @
496870dd
class
StuckCiBuildsWorker
include
Sidekiq
::
Worker
include
Sidetiq
::
Schedulable
BUILD_STUCK_TIMEOUT
=
1
.
day
recurrence
{
daily
}
def
perform
Rails
.
logger
.
info
'Cleaning stuck builds'
...
...
config/initializers/sidekiq.rb
View file @
496870dd
...
...
@@ -17,6 +17,12 @@ Sidekiq.configure_server do |config|
chain
.
add
Gitlab
::
SidekiqMiddleware
::
ArgumentsLogger
if
ENV
[
'SIDEKIQ_LOG_ARGUMENTS'
]
chain
.
add
Gitlab
::
SidekiqMiddleware
::
MemoryKiller
if
ENV
[
'SIDEKIQ_MEMORY_KILLER_MAX_RSS'
]
end
# Sidekiq-cron: load recurring jobs from schedule.yml
schedule_file
=
'config/schedule.yml'
if
File
.
exists?
(
schedule_file
)
Sidekiq
::
Cron
::
Job
.
load_from_hash
YAML
.
load_file
(
schedule_file
)
end
end
Sidekiq
.
configure_client
do
|
config
|
...
...
config/routes.rb
View file @
496870dd
require
'sidekiq/web'
require
'sidekiq/cron/web'
require
'api/api'
Rails
.
application
.
routes
.
draw
do
...
...
config/schedule.yml
0 → 100644
View file @
496870dd
# Here is a list of jobs that are scheduled to run periodically.
# We use a UNIX cron notation to specify execution schedule.
#
# Please read here for more information:
# https://github.com/ondrejbartas/sidekiq-cron#adding-cron-job
stuck_ci_builds_worker
:
cron
:
"
0
0
*
*
*"
class
:
"
StuckCiBuildsWorker"
queue
:
"
default"
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