forked from I2P_Developers/i2p.i2p
i2psnark:
- Refactor to allow running a single Snark without a SnarkManager again,
by moving some things from SnarkManager to I2PSnarkUtil,
having Snark call completeListener callbacks,
and having Storage call storageListener callbacks.
This is in preparation for using Snark for router updates.
Step 2 is to allow multiple I2PSnarkUtil instances.
- Big rewrite of Storage to open file descriptors on demand, and
close them when unused, so we can support large numbers of torrents.
This commit is contained in:
@@ -32,7 +32,7 @@ import java.util.TimerTask;
|
||||
*/
|
||||
class PeerCheckerTask extends TimerTask
|
||||
{
|
||||
private final long KILOPERSECOND = 1024*(PeerCoordinator.CHECK_PERIOD/1000);
|
||||
private static final long KILOPERSECOND = 1024*(PeerCoordinator.CHECK_PERIOD/1000);
|
||||
|
||||
private final PeerCoordinator coordinator;
|
||||
|
||||
@@ -247,6 +247,10 @@ class PeerCheckerTask extends TimerTask
|
||||
// store the rates
|
||||
coordinator.setRateHistory(uploaded, downloaded);
|
||||
|
||||
// close out unused files, but we don't need to do it every time
|
||||
if (random.nextInt(4) == 0)
|
||||
coordinator.getStorage().cleanRAFs();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user