Skip to content

Commit

Permalink
fix network timeout bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
iluhcm committed Feb 5, 2016
1 parent 6782f85 commit d0849fb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion red/com/xl/database/DatabaseTreeModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class DatabaseTreeModel {
public DatabaseTreeModel() {
List<String> databaseNames = DatabaseManager.getInstance().getAllDatabase();
root = new DefaultMutableTreeNode("Samples in MySQL Database");
allSamples = new HashSet<>();
allSamples = new HashSet<String>();
DefaultTreeModel treeModel = new DefaultTreeModel(root);
for (String databaseName : databaseNames) {
DefaultMutableTreeNode parentNode = new DefaultMutableTreeNode(databaseName);
Expand Down
2 changes: 2 additions & 0 deletions red/com/xl/net/genomes/UpdateChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ public static String getLatestVersionNumber() throws NetworkException {
URL updateURL = new URL(Global.VERSION_PAGE);

URLConnection connection = updateURL.openConnection();
connection.setConnectTimeout(10000);
connection.setReadTimeout(10000);
connection.setUseCaches(false);

DataInputStream d = new DataInputStream(new BufferedInputStream(connection.getInputStream()));
Expand Down
1 change: 0 additions & 1 deletion red/com/xl/parsers/annotationparsers/IgvGenomeParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ private void parseNewFasta(String fastaFile, String fastaCacheFile) throws RedEx
"RED has detected there is no fasta file in your system.\n"
+ "The fasta file would be downloaded on the background after hitting 'ok' button. Would you like to download it?",
"Download fasta file", JOptionPane.OK_CANCEL_OPTION);
logger.info("Answer: " + ans);
if (ans == 0) {
FastaFileParser parser = new FastaFileParser(genome);
parser.parseNewFasta(fastaFile, fastaCacheFile);
Expand Down
2 changes: 1 addition & 1 deletion red/com/xl/utils/NetworkDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class NetworkDetector {
private static final Logger logger = LoggerFactory.getLogger(NetworkDetector.class);

public static void isNetworkAvailable(INetwork listener) {
accessNetWork("http://www.github.com", listener);
accessNetWork("http://www.microsoft.com", listener);
}

public static void accessNetWork(final String path, final INetwork listener) {
Expand Down

0 comments on commit d0849fb

Please sign in to comment.