only create one ProcFileMirror
This commit is contained in:
parent
2ab9ea67a6
commit
d53c03ec3d
|
@ -128,13 +128,16 @@ public class Watch {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ProcFileMirror mirror =
|
||||||
|
new ProcFileMirror(sigar, "./proc");
|
||||||
|
|
||||||
watcher.setInterval(watcherThread.getInterval());
|
watcher.setInterval(watcherThread.getInterval());
|
||||||
|
mirror.setInterval(watcherThread.getInterval());
|
||||||
|
mirror.setExpire(60);
|
||||||
|
|
||||||
for (int i=0; i<args.length; i++) {
|
for (int i=0; i<args.length; i++) {
|
||||||
String arg = args[i];
|
String arg = args[i];
|
||||||
if (arg.startsWith("/proc/")) {
|
if (arg.startsWith("/proc/")) {
|
||||||
ProcFileMirror mirror =
|
|
||||||
new ProcFileMirror(sigar, "./proc");
|
|
||||||
watcherThread.add(mirror);
|
|
||||||
mirror.add(arg);
|
mirror.add(arg);
|
||||||
|
|
||||||
arg = mirror.getProcFile(arg);
|
arg = mirror.getProcFile(arg);
|
||||||
|
@ -148,6 +151,7 @@ public class Watch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watcherThread.add(mirror);
|
||||||
watcherThread.add(watcher);
|
watcherThread.add(watcher);
|
||||||
|
|
||||||
watcherThread.doStart();
|
watcherThread.doStart();
|
||||||
|
|
Loading…
Reference in New Issue