Bug correction.

This commit is contained in:
didfet
2015-03-17 16:04:32 +01:00
parent 616f883f49
commit 2b4c556ca0

View File

@@ -59,7 +59,9 @@ public class FileReader {
for(FileState state : fileList) { for(FileState state : fileList) {
eventCount += readFile(state, spoolSize - eventCount); eventCount += readFile(state, spoolSize - eventCount);
} }
adapter.sendEvents(eventList); if(eventCount > 0) {
adapter.sendEvents(eventList);
}
for(FileState state : fileList) { for(FileState state : fileList) {
state.setPointer(pointerMap.get(state.getFile())); state.setPointer(pointerMap.get(state.getFile()));
} }
@@ -82,7 +84,7 @@ public class FileReader {
private long readLines(FileState state, int spaceLeftInSpool) throws IOException { private long readLines(FileState state, int spaceLeftInSpool) throws IOException {
RandomAccessFile reader = state.getRandomAccessFile(); RandomAccessFile reader = state.getRandomAccessFile();
long pos = reader.getFilePointer(); long pos = state.getPointer();
reader.seek(pos); reader.seek(pos);
String line = readLine(reader); String line = readLine(reader);
while (line != null && spaceLeftInSpool > 0) { while (line != null && spaceLeftInSpool > 0) {