only load a file filter definition if the definition has been modified since the last load

This commit is contained in:
zab2
2019-11-21 15:12:04 +00:00
parent 131ebc4d5a
commit 252a7972a1

View File

@@ -18,6 +18,7 @@ import net.i2p.data.Hash;
class FileFilterDefinitionElement extends FilterDefinitionElement {
private final File file;
private volatile long lastLoading;
/**
* @param file file to read the remote destinations from
@@ -30,8 +31,9 @@ class FileFilterDefinitionElement extends FilterDefinitionElement {
@Override
public void update(Map<Hash, DestTracker> map) throws IOException {
if (!(file.exists() && file.isFile()))
if (!(file.exists() && file.isFile() && file.lastModified() > lastLoading))
return;
lastLoading = System.currentTimeMillis();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(file));