The FileListingThread runs an infinite loop with a configurable polling interval for performing file listings. When an interval of 100ms is configured, I would expect that performListing() is invoked approximately every 100ms. However, it seems to run every 200ms only.
Steps to reproduce
Run the following test and add a log statement inside FileListingThread when performListing() is called.
@Test
public void pollingIntervalTest() throws IOException {
Map<String, Object> map = new HashMap<>();
map.put("inputDirectory", directory.toString());
map.put("pollingInterval", 100);
try {
listingThread = new FileListingThread(FileSourceConfig.load(map), workQueue, inProcess, recentlyProcessed);
executor.execute(listingThread);
generateFiles(1);
Thread.sleep(5000);
} catch (InterruptedException | ExecutionException e) {
fail("Unable to generate files" + e.getLocalizedMessage());
} finally {
cleanUp();
}
}
The log output shows that performListing() is executed approximately every 200ms:
2026-04-04T12:01:04,938+0200 INFO [pool-2-thread-1] o.a.p.i.f.FileListingThread - Perform file listing
2026-04-04T12:01:05,139+0200 INFO [pool-2-thread-1] o.a.p.i.f.FileListingThread - Perform file listing
2026-04-04T12:01:05,339+0200 INFO [pool-2-thread-1] o.a.p.i.f.FileListingThread - Perform file listing
2026-04-04T12:01:05,539+0200 INFO [pool-2-thread-1] o.a.p.i.f.FileListingThread - Perform file listing
Are you willing to submit a PR?
The
FileListingThreadruns an infinite loop with a configurable polling interval for performing file listings. When an interval of 100ms is configured, I would expect thatperformListing()is invoked approximately every 100ms. However, it seems to run every 200ms only.Steps to reproduce
Run the following test and add a log statement inside
FileListingThreadwhenperformListing()is called.The log output shows that
performListing()is executed approximately every 200ms:Are you willing to submit a PR?