Skip to content

Commit a358780

Browse files
committed
Limited the maximum number of threads in Synthesiser to increase
stability.
1 parent e654e29 commit a358780

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/com/darkprograms/speech/synthesiser/Synthesiser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ public InputStream getMP3Data(String synthText) throws IOException{
136136
* @throws IOException Throws exception if it cannot complete the request
137137
*/
138138
public InputStream getMP3Data(List<String> synthText) throws IOException{
139-
//Uses an executor service pool for concurrency
140-
ExecutorService pool = Executors.newFixedThreadPool(synthText.size());
139+
//Uses an executor service pool for concurrency. Limit to 1000 threads max.
140+
ExecutorService pool = Executors.newFixedThreadPool(1000);
141141
//Stores the Future (Data that will be returned in the future)
142142
Set<Future<InputStream>> set = new LinkedHashSet<Future<InputStream>>(synthText.size());
143143
for(String part: synthText){ //Iterates through the list

0 commit comments

Comments
 (0)