Use constant for four hours and reuse them in the versionchecker
This commit is contained in:
parent
6d45cecbf2
commit
00f67e94e4
1 changed files with 5 additions and 4 deletions
|
@ -20,15 +20,16 @@ import cpw.mods.fml.common.event.FMLInterModComms;
|
||||||
|
|
||||||
public class VersionChecker implements Runnable
|
public class VersionChecker implements Runnable
|
||||||
{
|
{
|
||||||
|
private static final int FOUR_HOURS = 1000 * 3600 * 4;
|
||||||
|
|
||||||
private final long delay;
|
private final long delay;
|
||||||
|
|
||||||
public VersionChecker()
|
public VersionChecker()
|
||||||
{
|
{
|
||||||
final int fiveHours = 1000 * 3600 * 5;
|
|
||||||
final long now = new Date().getTime();
|
final long now = new Date().getTime();
|
||||||
final long timeDiff = now - AEConfig.instance.latestTimeStamp;
|
final long timeDiff = now - AEConfig.instance.latestTimeStamp;
|
||||||
|
|
||||||
this.delay = Math.max( 1, fiveHours - timeDiff);
|
this.delay = Math.max( 1, FOUR_HOURS - timeDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -107,13 +108,13 @@ public class VersionChecker implements Runnable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep( 1000 * 3600 * 4 );
|
sleep( FOUR_HOURS );
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
sleep( 1000 * 3600 * 4 );
|
sleep( FOUR_HOURS );
|
||||||
}
|
}
|
||||||
catch (InterruptedException e1)
|
catch (InterruptedException e1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue