mirror of
https://github.com/Febbweiss/logstash-forwarder-java.git
synced 2026-03-04 22:25:39 +00:00
Changed dead time type from int to long
This commit is contained in:
@@ -77,7 +77,7 @@ public class FileWatcher {
|
|||||||
printWatchMap();
|
printWatchMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addFilesToWatch(String fileToWatch, Event fields, int deadTime) {
|
public void addFilesToWatch(String fileToWatch, Event fields, long deadTime) {
|
||||||
try {
|
try {
|
||||||
if(fileToWatch.equals("-")) {
|
if(fileToWatch.equals("-")) {
|
||||||
addStdIn(fields);
|
addStdIn(fields);
|
||||||
@@ -220,7 +220,7 @@ public class FileWatcher {
|
|||||||
removeMarkedFilesFromWatchMap();
|
removeMarkedFilesFromWatchMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSingleFile(String fileToWatch, Event fields, int deadTime) throws Exception {
|
private void addSingleFile(String fileToWatch, Event fields, long deadTime) throws Exception {
|
||||||
logger.info("Watching file : " + new File(fileToWatch).getCanonicalPath());
|
logger.info("Watching file : " + new File(fileToWatch).getCanonicalPath());
|
||||||
String directory = FilenameUtils.getFullPath(fileToWatch);
|
String directory = FilenameUtils.getFullPath(fileToWatch);
|
||||||
String fileName = FilenameUtils.getName(fileToWatch);
|
String fileName = FilenameUtils.getName(fileToWatch);
|
||||||
@@ -231,7 +231,7 @@ public class FileWatcher {
|
|||||||
initializeWatchMap(new File(directory), fileFilter, fields);
|
initializeWatchMap(new File(directory), fileFilter, fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addWildCardFiles(String filesToWatch, Event fields, int deadTime) throws Exception {
|
private void addWildCardFiles(String filesToWatch, Event fields, long deadTime) throws Exception {
|
||||||
logger.info("Watching wildcard files : " + filesToWatch);
|
logger.info("Watching wildcard files : " + filesToWatch);
|
||||||
String directory = FilenameUtils.getFullPath(filesToWatch);
|
String directory = FilenameUtils.getFullPath(filesToWatch);
|
||||||
String wildcard = FilenameUtils.getName(filesToWatch);
|
String wildcard = FilenameUtils.getName(filesToWatch);
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ public class FilesSection {
|
|||||||
return deadTime;
|
return deadTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDeadTimeInSeconds() {
|
public long getDeadTimeInSeconds() {
|
||||||
int deadTimeInSeconds = 0;
|
long deadTimeInSeconds = 0;
|
||||||
String remaining = deadTime;
|
String remaining = deadTime;
|
||||||
|
|
||||||
if(deadTime.contains("h")) {
|
if(deadTime.contains("h")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user