Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
app_push
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_server
app_push
Commits
69595ea1
Commit
69595ea1
authored
6 years ago
by
zmj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部署脚本,sidekiq 配置
修改god group name fix deploy config
parent
da69b935
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
config/deploy.rb
+8
-3
config/sidekiq.god
+2
-2
No files found.
config/deploy.rb
View file @
69595ea1
...
...
@@ -4,7 +4,11 @@ lock '~> 3.11.0'
set
:rvm_type
,
:auto
# Defaults to: :auto
set
:rvm_ruby_version
,
'2.6.0'
set
:god_sidekiq_group
,
'app_push_sidekiq'
set
:god_sidekiq_group
,
'push_service'
# 当前服务器有app 这个角色。
# gem capistrano-sidekiq 默认值 set :sidekiq_roles, fetch(:sidekiq_role, :app)
# 因此会造成执行cap sidekiq:start,但是生产环境因为使用了god,不需要执行这个任务
set
:sidekiq_roles
,
'sidekiq'
#生产环境没有这个角色。
set
:puma_role
,
'app'
set
:puma_env
,
fetch
(
:rack_env
,
fetch
(
:rails_env
,
'production'
))
...
...
@@ -12,6 +16,7 @@ set :linked_files, %w[
config/credentials.yml.enc
config/master.key
config/settings.yml
config/puma.rb
]
set
:linked_dirs
,
%w[
...
...
@@ -30,9 +35,9 @@ namespace :sidekiq do
'source ~/.rvm/scripts/rvm'
,
'god'
,
"god stop
#{
fetch
(
:god_sidekiq_group
)
}
"
,
'sleep
3
0'
,
'sleep
1
0'
,
"god remove
#{
fetch
(
:god_sidekiq_group
)
}
"
,
"god load
#{
release_path
}
/config/sidekiq.god"
"god load
#{
release_path
}
/config/sidekiq.god"
,
].
join
(
'; '
)
end
end
...
...
This diff is collapsed.
Click to expand it.
config/sidekiq.god
View file @
69595ea1
...
...
@@ -18,8 +18,8 @@ QUEUES.each { |queue_name, queue_conf|
w.log = sidekiq_log_file
w.interval = 30.seconds
w.name = "
ikcrm_operating_sidekiq
_#{queue_name}-#{pid_index}"
w.group = "
ikcrm_operating_sidekiq
"
w.name = "
push_service
_#{queue_name}-#{pid_index}"
w.group = "
push_service
"
w.start = "cd #{APP_ROOT}; DB_USE_SLAVE=#{!!(queue_name.to_s =~ /slave/)} DB_POOL_SIZE=#{queue_conf[:concurrency] + 2} nohup bundle exec sidekiq -C config/sidekiq.yml -c #{queue_conf[:concurrency]} -e production --queue #{queue_name},#{queue_conf[:priority]} -i #{pid_index} -P #{sidekiq_pid_file} >> #{sidekiq_log_file} 2>&1 &"
w.stop = "if [ -d #{APP_ROOT} ] && [ -f #{sidekiq_pid_file} ] && kill -0 `cat #{sidekiq_pid_file}`> /dev/null 2>&1; then cd #{APP_ROOT} && bundle exec sidekiqctl stop #{sidekiq_pid_file} 10 ; else echo 'Sidekiq is not running'; fi"
...
...
This diff is collapsed.
Click to expand it.
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