1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

add script to set process concurrency on start/restart/run from config

هذا الالتزام موجود في:
Adam Cooke
2017-04-26 20:48:04 +01:00
الأصل 8da33ba58e
التزام ff645a6677
4 ملفات معدلة مع 24 إضافات و0 حذوفات

2
.gitignore مباع
عرض الملف

@@ -24,3 +24,5 @@ config/signing.key
public/assets
vendor/bundle
Procfile.local

عرض الملف

@@ -30,6 +30,7 @@ cd $ROOT_DIR
# Run the right command
case "$1" in
start)
run "bundle exec ruby script/update_process_concurrency.rb"
run "procodile start"
;;
@@ -38,6 +39,7 @@ case "$1" in
;;
restart)
run "bundle exec ruby script/update_process_concurrency.rb"
run "procodile restart"
;;
@@ -46,6 +48,7 @@ case "$1" in
;;
run)
run "bundle exec ruby script/update_process_concurrency.rb"
run "LOG_TO_STDOUT=1 procodile start -f --no-respawn --stop-when-none"
;;

عرض الملف

@@ -17,6 +17,9 @@ general:
use_ip_pools: false
exception_url: null
workers:
quantity: 1
logging:
stdout: false
max_log_file_size: 20

عرض الملف

@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
require File.expand_path('../../lib/postal/config', __FILE__)
worker_quantity = Postal.config.workers&.quantity || 1
hash = {
'processes' => {
'worker' => {
'quantity' => worker_quantity
},
'fast' => {
'quantity' => Postal.config.fast_server ? 1 : 0
}
}
}.to_yaml
File.open(Postal.app_root.join('Procfile.local'), 'w') { |f| f.write(hash + "\n")}