|
69 | 69 | * <li><code>LGTM_INDEX_TYPESCRIPT</code>: whether to extract TypeScript |
70 | 70 | * <li><code>LGTM_INDEX_FILETYPES</code>: a newline-separated list of ".extension:filetype" pairs |
71 | 71 | * specifying which {@link FileType} to use for the given extension |
72 | | - * <li><code>LGTM_INDEX_THREADS</code>: the maximum number of files to extract in parallel |
| 72 | + * <li><code>LGTM_THREADS</code>: the maximum number of files to extract in parallel |
73 | 73 | * <li><code>LGTM_TRAP_CACHE</code>: the path of a directory to use for trap caching |
74 | 74 | * <li><code>LGTM_TRAP_CACHE_BOUND</code>: the size to bound the trap cache to |
75 | 75 | * </ul> |
|
163 | 163 | * following environment variables are available: |
164 | 164 | * |
165 | 165 | * <ul> |
166 | | - * <li><code>LGTM_INDEX_THREADS</code> determines how many threads are used for parallel |
| 166 | + * <li><code>LGTM_THREADS</code> determines how many threads are used for parallel |
167 | 167 | * extraction of JavaScript files (TypeScript files cannot currently be extracted in |
168 | | - * parallel). If left unspecified, the extractor uses as many threads as there are cores. |
| 168 | + * parallel). If left unspecified, the extractor uses a single thread. |
169 | 169 | * <li><code>LGTM_TRAP_CACHE</code> and <code>LGTM_TRAP_CACHE_BOUND</code> can be used to specify |
170 | 170 | * the location and size of a trap cache to be used during extraction. |
171 | 171 | * </ul> |
@@ -405,8 +405,8 @@ public void run() throws IOException { |
405 | 405 | } |
406 | 406 |
|
407 | 407 | private void startThreadPool() { |
408 | | - int defaultNumThreads = Runtime.getRuntime().availableProcessors(); |
409 | | - int numThreads = Env.systemEnv().getInt("LGTM_INDEX_THREADS", defaultNumThreads); |
| 408 | + int defaultNumThreads = 1; |
| 409 | + int numThreads = Env.systemEnv().getInt("LGTM_THREADS", defaultNumThreads); |
410 | 410 | if (numThreads > 1) { |
411 | 411 | System.out.println("Parallel extraction with " + numThreads + " threads."); |
412 | 412 | threadPool = Executors.newFixedThreadPool(numThreads); |
|
0 commit comments