-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5a047e
commit eabe08e
Showing
20 changed files
with
89 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,31 @@ | ||
require 'etc' | ||
require 'os' | ||
require 'colorize' | ||
# get the ruby Implementation | ||
|
||
if OS.windows? | ||
puts "You are using Windows. Not multi-threading...".colorize(:red) | ||
puts "Starting Server...".colorize(:green) | ||
rubyPort = 9292 | ||
rubyPort = ARGV[ARGV.index('-p') + 1] || ARGV[ARGV.index('--port') + 1] if ARGV.include?('-p') || ARGV.include?('--port') | ||
if ENV['RACK_ENV'] == 'production' | ||
system("node node-server/server.js --ruby-port=#{rubyPort} --node-port=9293 &") | ||
else | ||
system("node node-server/server-dev.js --ruby-port=#{rubyPort} --node-port=9293 &") | ||
end | ||
elsif ENV['WP'] != nil | ||
workers ENV['WP'].to_i | ||
before_fork do | ||
puts "The amount of proccesses is: #{ENV['WP']}".colorize(:green) | ||
puts "Master Process ID: #{Process.pid}".colorize(:green) | ||
puts "Starting Server...".colorize(:green) | ||
rubyPort = 9292 | ||
cpuCount = Etc.nprocessors | ||
rubyPort = ARGV[ARGV.index('-p') + 1] || ARGV[ARGV.index('--port') + 1] if ARGV.include?('-p') || ARGV.include?('--port') | ||
if ENV['RACK_ENV'] == 'production' | ||
system("node node-server/server.js --ruby-port=#{rubyPort} --node-port=9293 &") | ||
else | ||
system("node node-server/server-dev.js --ruby-port=#{rubyPort} --node-port=9293 &") | ||
end | ||
end | ||
else | ||
if RUBY_ENGINE != 'jruby' && RUBY_ENGINE != 'truffleruby' | ||
workers Etc.nprocessors | ||
before_fork do | ||
puts "Master Process ID: #{Process.pid}".colorize(:green) | ||
puts "Starting Server...".colorize(:green) | ||
rubyPort = 9292 | ||
cpuCount = Etc.nprocessors | ||
rubyPort = ARGV[ARGV.index('-p') + 1] || ARGV[ARGV.index('--port') + 1] if ARGV.include?('-p') || ARGV.include?('--port') | ||
if ENV['RACK_ENV'] == 'production' | ||
system("node node-server/server.js --ruby-port=#{rubyPort} --node-port=9293 &") | ||
else | ||
system("node node-server/server-dev.js --ruby-port=#{rubyPort} --node-port=9293 &") | ||
end | ||
end | ||
else | ||
puts "You are using JRuby or TruffleRuby. Not using workers...".colorize(:red) | ||
puts "Starting Server...".colorize(:green) | ||
rubyPort = 9292 | ||
rubyPort = ARGV[ARGV.index('-p') + 1] || ARGV[ARGV.index('--port') + 1] if ARGV.include?('-p') || ARGV.include?('--port') | ||
if ENV['RACK_ENV'] == 'production' | ||
system("node node-server/server.js --ruby-port=#{rubyPort} --node-port=9293 &") | ||
else | ||
system("node node-server/server-dev.js --ruby-port=#{rubyPort} --node-port=9293 &") | ||
end | ||
end | ||
end | ||
|
||
preload_app! | ||
port ENV['PORT'] || 9292 | ||
port ENV['PORT'] || 9293 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.