Skip to content
Browse files

Added keep alive logs when in verbose and not printing the files curr…

…ently being copied/removed.
  • Loading branch information...
1 parent 7796d15 commit 51bb06753cd2cf22f3fc4c96f8c161525bd635cf Amit Apple committed Feb 12, 2013
Showing with 29 additions and 1 deletion.
  1. +12 −0 bin/kuduSync.js
  2. +16 −0 lib/Main.ts
  3. +1 −1 test/functionalTests.js
View
12 bin/kuduSync.js
@@ -542,15 +542,27 @@ function main() {
};
}
var counter = 0;
+ var nextLogTime = null;
if(verbose && verbose > 0) {
log = function (msg) {
+ var updateLogTime = false;
if(counter < verbose) {
console.log(msg);
} else {
if(counter == verbose) {
console.log("Omitting next output lines...");
+ updateLogTime = true;
+ } else {
+ if(new Date().getTime() >= nextLogTime.getTime()) {
+ console.log("Processed " + (counter - 1) + " files...");
+ updateLogTime = true;
+ }
}
}
+ if(updateLogTime) {
+ var currentDate = new Date();
+ nextLogTime = new Date(currentDate.getTime() + 20000);
+ }
counter++;
};
}
View
16 lib/Main.ts
@@ -54,14 +54,30 @@ function main() {
}
var counter = 0;
+ var nextLogTime: Date = null;
if (verbose && verbose > 0) {
log = (msg) => {
+ var updateLogTime: bool = false;
+
if (counter < verbose) {
console.log(msg);
}
else if (counter == verbose) {
console.log("Omitting next output lines...");
+ updateLogTime = true;
+ }
+ else {
+ if (new Date().getTime() >= nextLogTime.getTime()) {
+ console.log("Processed " + (counter - 1) + " files...");
+ updateLogTime = true;
+ }
}
+
+ if (updateLogTime) {
+ var currentDate = new Date();
+ nextLogTime = new Date(currentDate.getTime() + 20000);
+ }
+
counter++;
};
}
View
2 test/functionalTests.js
@@ -339,7 +339,7 @@ function runKuduSync(prevManifestFile, nextManifestFile, ignore, whatIf, callbac
var command = testTarget.cmd + " -f " + from + " -t " + to + " -n " + nextManifestPath + " -p " + prevManifestPath;
if (ignore) {
- command += " -i '" + ignore + "'";
+ command += " -i \"" + ignore + "\"";
}
if (whatIf) {

0 comments on commit 51bb067

Please sign in to comment.
Something went wrong with that request. Please try again.