Skip to content

Commit 427d0db

Browse files
JustinWonjaeParksoimkim
authored andcommitted
Add thread option for run_scanoss_py library
1 parent 68d436a commit 427d0db

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/fosslight_source/run_scanoss.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
_PKG_NAME = "fosslight_source"
2121

2222

23-
def run_scanoss_py(path_to_scan, output_file_name="", format="", called_by_cli=False, write_json_file=False):
23+
def run_scanoss_py(path_to_scan, output_file_name="", format="", called_by_cli=False, write_json_file=False, num_threads=-1):
2424
"""
2525
Run scanoss.py for the given path.
2626
@@ -61,6 +61,11 @@ def run_scanoss_py(path_to_scan, output_file_name="", format="", called_by_cli=F
6161

6262
scan_command += output_json_file + " " + path_to_scan
6363

64+
if num_threads > 0:
65+
scan_command += " -T " + str(num_threads)
66+
else:
67+
scan_command += " -T " + "30"
68+
6469
try:
6570
os.system(scan_command)
6671
st_json = open(output_json_file, "r")

0 commit comments

Comments
 (0)