مراية لـ
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
هذا الالتزام موجود في:
2
.gitignore
مباع
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
|
||||
|
||||
16
script/update_process_concurrency.rb
Executable file
16
script/update_process_concurrency.rb
Executable file
@@ -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")}
|
||||
المرجع في مشكلة جديدة
حظر مستخدم