lib/steep/drivers/checkfile.rb in steep-1.2.0.pre.1 vs lib/steep/drivers/checkfile.rb in steep-1.2.0
- old
+ new
@@ -6,22 +6,24 @@
attr_reader :stdout
attr_reader :stderr
attr_reader :command_line_args
attr_accessor :all_ruby, :all_rbs
attr_reader :stdin_input
+ attr_reader :jobs_option
include Utils::DriverHelper
- include Utils::JobsCount
def initialize(stdout:, stderr:)
@stdout = stdout
@stderr = stderr
@command_line_args = []
@all_rbs = false
@all_ruby = false
@stdin_input = {}
+
+ @jobs_option = Utils::JobsOption.new()
end
def run
return 0 if command_line_args.empty? && !all_rbs && !all_ruby && stdin_input.empty?
@@ -86,22 +88,25 @@
end
files = target_paths + signature_paths
count =
- if files.size >= jobs_count
- jobs_count
+ if jobs_option.jobs_count
+ jobs_option.jobs_count
else
- files.size + 2
+ [
+ files.size + 2,
+ jobs_option.default_jobs_count
+ ].min || raise
end
Steep.logger.info { "Starting #{count} workers for #{files.size} files..." }
typecheck_workers = Server::WorkerProcess.spawn_typecheck_workers(
steepfile: project.steepfile_path,
args: [],
delay_shutdown: true,
- steep_command: steep_command,
+ steep_command: jobs_option.steep_command_value,
count: count
)
master = Server::Master.new(
project: project,