mirror of
https://github.com/anthonyraymond/joal.git
synced 2024-11-10 09:02:31 +08:00
TorrentFileProvider has now a parameter to change the scan interval for torrent folder
This commit is contained in:
parent
8aff34b241
commit
219304b6b6
1 changed files with 5 additions and 2 deletions
|
@ -30,6 +30,10 @@ public class TorrentFileProvider {
|
|||
private final Random rand;
|
||||
|
||||
public TorrentFileProvider(final Path torrentFolder) {
|
||||
this(torrentFolder, 30 * 1000);
|
||||
}
|
||||
|
||||
public TorrentFileProvider(final Path torrentFolder, final int scanInterval) {
|
||||
this.torrentFiles = Collections.synchronizedList(new ArrayList<>());
|
||||
this.rand = new Random();
|
||||
|
||||
|
@ -37,7 +41,7 @@ public class TorrentFileProvider {
|
|||
.forEach(torrentFiles::add);
|
||||
|
||||
observer = new FileAlterationObserver(torrentFolder.toFile(), torrentFileFilter);
|
||||
monitor = new FileAlterationMonitor(30 * 1000);
|
||||
monitor = new FileAlterationMonitor(scanInterval);
|
||||
|
||||
observer.addListener(new FileAlterationListenerAdaptor() {
|
||||
@Override
|
||||
|
@ -111,5 +115,4 @@ public class TorrentFileProvider {
|
|||
this.monitor.removeObserver(observer);
|
||||
logger.trace("TorrentFileProvider stopped.");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue