Explorar el Código

decaffeinate: Run post-processing cleanups on expire_docops.coffee and 2 other files

decaffeinate hace 5 años
padre
commit
03cbad4e9f

+ 7 - 1
services/document-updater/expire_docops.js

@@ -1,3 +1,9 @@
+/* eslint-disable
+    handle-callback-err,
+    no-unused-vars,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
  * DS101: Remove unnecessary use of Array.from
  * DS101: Remove unnecessary use of Array.from
@@ -19,7 +25,7 @@ const getKeysFromNode = function(node, pattern, callback) {
         if (error != null) { return callback(error); }
         if (error != null) { return callback(error); }
         [cursor, keys] = Array.from(reply);
         [cursor, keys] = Array.from(reply);
         console.log("SCAN", keys.length);
         console.log("SCAN", keys.length);
-        for (let key of Array.from(keys)) {
+        for (const key of Array.from(keys)) {
             keySet[key] = true;
             keySet[key] = true;
         }
         }
         if (cursor === '0') {  // note redis returns string result not numeric
         if (cursor === '0') {  // note redis returns string result not numeric

+ 8 - 3
services/document-updater/test/cluster_failover/coffee/test_blpop_failover.js

@@ -1,3 +1,8 @@
+/* eslint-disable
+    no-unused-vars,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
  * DS101: Remove unnecessary use of Array.from
  * DS101: Remove unnecessary use of Array.from
@@ -20,7 +25,7 @@ const rclient2 = redis.createClient({cluster: [{
 let counter = 0;
 let counter = 0;
 const sendPing = function(cb) {
 const sendPing = function(cb) {
 	if (cb == null) { cb = function() {}; }
 	if (cb == null) { cb = function() {}; }
-	return rclient1.rpush("test-blpop", counter, function(error) {
+	return rclient1.rpush("test-blpop", counter, (error) => {
 		if (error != null) { console.error("[SENDING ERROR]", error.message); }
 		if (error != null) { console.error("[SENDING ERROR]", error.message); }
 		if ((error == null)) {
 		if ((error == null)) {
 			counter += 1;
 			counter += 1;
@@ -30,7 +35,7 @@ const sendPing = function(cb) {
 };
 };
 
 
 let previous = null;
 let previous = null;
-const listenForPing = cb => rclient2.blpop("test-blpop", 200, function(error, result) {
+const listenForPing = cb => rclient2.blpop("test-blpop", 200, (error, result) => {
     if (error != null) { return cb(error); }
     if (error != null) { return cb(error); }
     let [key, value] = Array.from(result);
     let [key, value] = Array.from(result);
     value = parseInt(value, 10);
     value = parseInt(value, 10);
@@ -47,7 +52,7 @@ const listenForPing = cb => rclient2.blpop("test-blpop", 200, function(error, re
 const PING_DELAY = 100;
 const PING_DELAY = 100;
 (sendPings = () => sendPing(() => setTimeout(sendPings, PING_DELAY)))();
 (sendPings = () => sendPing(() => setTimeout(sendPings, PING_DELAY)))();
 
 
-(listenInBackground = () => listenForPing(function(error, value) {
+(listenInBackground = () => listenForPing((error, value) => {
     if (error) { console.error("[RECEIVING ERROR]", error.message); }
     if (error) { console.error("[RECEIVING ERROR]", error.message); }
     return setTimeout(listenInBackground);
     return setTimeout(listenInBackground);
 }))();
 }))();

+ 7 - 2
services/document-updater/test/cluster_failover/coffee/test_pubsub_failover.js

@@ -1,3 +1,8 @@
+/* eslint-disable
+    no-return-assign,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
  * DS102: Remove unnecessary code created because of implicit returns
  * DS102: Remove unnecessary code created because of implicit returns
@@ -19,7 +24,7 @@ const rclient2 = redis.createClient({cluster: [{
 let counter = 0;
 let counter = 0;
 const sendPing = function(cb) {
 const sendPing = function(cb) {
 	if (cb == null) { cb = function() {}; }
 	if (cb == null) { cb = function() {}; }
-	return rclient1.publish("test-pubsub", counter, function(error) {
+	return rclient1.publish("test-pubsub", counter, (error) => {
 		if (error != null) { console.error("[SENDING ERROR]", error.message); }
 		if (error != null) { console.error("[SENDING ERROR]", error.message); }
 		if ((error == null)) {
 		if ((error == null)) {
 			counter += 1;
 			counter += 1;
@@ -30,7 +35,7 @@ const sendPing = function(cb) {
 
 
 let previous = null;
 let previous = null;
 rclient2.subscribe("test-pubsub");
 rclient2.subscribe("test-pubsub");
-rclient2.on("message", function(channel, value) {
+rclient2.on("message", (channel, value) => {
 	value = parseInt(value, 10);
 	value = parseInt(value, 10);
 	if ((value % 10) === 0) {
 	if ((value % 10) === 0) {
 		console.log(".");
 		console.log(".");