-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Router: don't persist client db's on disk. Add a job which can clean …
…up the subdbs periodically
- Loading branch information
eyedeekay
committed
Sep 7, 2023
1 parent
4e63234
commit 76fd9ab
Showing
5 changed files
with
49 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.i2p.router; | ||
|
||
import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseSegmentor; | ||
|
||
public class CleanupNetDbJob extends JobImpl { | ||
private final RouterContext ctx; | ||
|
||
public CleanupNetDbJob(RouterContext context) { | ||
super(context); | ||
ctx = context; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "CleanupNetDbJob"; | ||
} | ||
|
||
@Override | ||
public void runJob() { | ||
FloodfillNetworkDatabaseSegmentor fnds = (FloodfillNetworkDatabaseSegmentor) ctx.netDb(); | ||
fnds.removeDeadSubDbs(ctx.clientManager().listClients()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters