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

This commit is contained in:
Adam Cooke
2017-04-26 20:48:04 +01:00
parent 8da33ba58e
commit ff645a6677
4 changed files with 24 additions and 0 deletions
+16
View 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")}