مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-01-16 21:23:37 +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
|
public/assets
|
||||||
vendor/bundle
|
vendor/bundle
|
||||||
|
|
||||||
|
Procfile.local
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ cd $ROOT_DIR
|
|||||||
# Run the right command
|
# Run the right command
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
|
run "bundle exec ruby script/update_process_concurrency.rb"
|
||||||
run "procodile start"
|
run "procodile start"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
restart)
|
restart)
|
||||||
|
run "bundle exec ruby script/update_process_concurrency.rb"
|
||||||
run "procodile restart"
|
run "procodile restart"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -46,6 +48,7 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
run)
|
run)
|
||||||
|
run "bundle exec ruby script/update_process_concurrency.rb"
|
||||||
run "LOG_TO_STDOUT=1 procodile start -f --no-respawn --stop-when-none"
|
run "LOG_TO_STDOUT=1 procodile start -f --no-respawn --stop-when-none"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ general:
|
|||||||
use_ip_pools: false
|
use_ip_pools: false
|
||||||
exception_url: null
|
exception_url: null
|
||||||
|
|
||||||
|
workers:
|
||||||
|
quantity: 1
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
stdout: false
|
stdout: false
|
||||||
max_log_file_size: 20
|
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")}
|
||||||
المرجع في مشكلة جديدة
حظر مستخدم