Skip to content

Commit

Permalink
minor: made timeout interval more configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
hrj committed Feb 28, 2015
1 parent 8e838f8 commit 1c22929
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Platform_Core/org/lobobrowser/main/PlatformInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
public class PlatformInit {
private static final String NATIVE_DIR_NAME = "native";
private static final long DAYS_MILLIS = 24 * 60 * 60 * 1000L;
private static final long SIXTY_DAYS_MILLIS = 60 * DAYS_MILLIS;
private static final long TIMEOUT_DAYS = 60;
private final SimpleThreadPool threadExecutor;

// private final GeneralSettings generalSettings;
Expand Down Expand Up @@ -317,15 +317,15 @@ private void checkReleaseDate() {
final String dateStr = relProps.getProperty(RELEASE_VERSION_RELEASE_DATE);
final SimpleDateFormat yyyyMMDDFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
final Date releaseDate = yyyyMMDDFormat.parse(dateStr);
final Date releaseDatePlus60Days = new Date(releaseDate.getTime() + SIXTY_DAYS_MILLIS);
final Date releaseDatePlusTimeout = new Date(releaseDate.getTime() + (TIMEOUT_DAYS * DAYS_MILLIS));
final Date currDate = new Date(System.currentTimeMillis());
if (releaseDatePlus60Days.before(currDate)) {
if (releaseDatePlusTimeout.before(currDate)) {
final String version = relProps.getProperty(RELEASE_VERSION_STRING);
final String checkForUpdatesMessage = "<html><h3><center>This version of gngr is old</center></h3><p>gngr "
+ version
+ "</p><p>Released on: "
+ releaseDate
+ "</p><p>This version is more than 60 days old and was not intended for long-time use.</p><p>Please check if a newer version is available on https://gngr.info</p></html>";
+ "</p><p>This version is more than " + TIMEOUT_DAYS + " days old and was not intended for long-time use.</p><p>Please check if a newer version is available on https://gngr.info</p></html>";
JOptionPane.showMessageDialog(null, checkForUpdatesMessage);
}
} catch (IOException | ParseException e) {
Expand Down

0 comments on commit 1c22929

Please sign in to comment.