Skip to content

Commit

Permalink
Add preference for max threads allowed when exporting
Browse files Browse the repository at this point in the history
* Experimental
* See #45
  • Loading branch information
Phillipus committed Aug 21, 2017
1 parent 1b8afb4 commit ec60660
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.util.Iterator;
import java.util.List;

import org.archicontribs.modelrepository.ModelRepositoryPlugin;
import org.archicontribs.modelrepository.preferences.IPreferenceConstants;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
Expand Down Expand Up @@ -126,7 +128,8 @@ public void exportModel() throws IOException {
createAndSaveResourceForFolder(copy, modelFolder);

// Now save all Resources
JobGroup jobgroup = new JobGroup("GraficoModelExporter", 0, 1); //$NON-NLS-1$
int maxThreads = ModelRepositoryPlugin.INSTANCE.getPreferenceStore().getInt(IPreferenceConstants.PREFS_EXPORT_MAX_THREADS);
JobGroup jobgroup = new JobGroup("GraficoModelExporter", maxThreads, 1); //$NON-NLS-1$

final ExceptionProgressMonitor pm = new ExceptionProgressMonitor();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ public interface IPreferenceConstants {
String PREFS_PROXY_HOST = "proxyHost"; //$NON-NLS-1$
String PREFS_PROXY_PORT = "proxyPort"; //$NON-NLS-1$
String PREFS_PROXY_REQUIRES_AUTHENTICATION = "proxyAuthenticate"; //$NON-NLS-1$

String PREFS_EXPORT_MAX_THREADS = "exportMaxThreads"; //$NON-NLS-1$
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ public void initializeDefaultPreferences() {
store.setDefault(PREFS_PROXY_REQUIRES_AUTHENTICATION, false);
store.setDefault(PREFS_PROXY_PORT, 8088);
store.setDefault(PREFS_PROXY_HOST, "localhost"); //$NON-NLS-1$

store.setDefault(PREFS_EXPORT_MAX_THREADS, 10);
}
}

0 comments on commit ec60660

Please sign in to comment.