From 03cbad4e9f10cc7fbe89b5f620d4948c927a3657 Mon Sep 17 00:00:00 2001 From: decaffeinate Date: Wed, 19 May 2021 20:25:07 +0100 Subject: [PATCH] decaffeinate: Run post-processing cleanups on expire_docops.coffee and 2 other files --- services/document-updater/expire_docops.js | 8 +++++++- .../cluster_failover/coffee/test_blpop_failover.js | 11 ++++++++--- .../cluster_failover/coffee/test_pubsub_failover.js | 9 +++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/services/document-updater/expire_docops.js b/services/document-updater/expire_docops.js index 59f498a181..811b0cc019 100644 --- a/services/document-updater/expire_docops.js +++ b/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: * DS101: Remove unnecessary use of Array.from @@ -19,7 +25,7 @@ const getKeysFromNode = function(node, pattern, callback) { if (error != null) { return callback(error); } [cursor, keys] = Array.from(reply); console.log("SCAN", keys.length); - for (let key of Array.from(keys)) { + for (const key of Array.from(keys)) { keySet[key] = true; } if (cursor === '0') { // note redis returns string result not numeric diff --git a/services/document-updater/test/cluster_failover/coffee/test_blpop_failover.js b/services/document-updater/test/cluster_failover/coffee/test_blpop_failover.js index 7c29240717..a356e683d4 100644 --- a/services/document-updater/test/cluster_failover/coffee/test_blpop_failover.js +++ b/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: * DS101: Remove unnecessary use of Array.from @@ -20,7 +25,7 @@ const rclient2 = redis.createClient({cluster: [{ let counter = 0; const sendPing = function(cb) { 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)) { counter += 1; @@ -30,7 +35,7 @@ const sendPing = function(cb) { }; 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); } let [key, value] = Array.from(result); value = parseInt(value, 10); @@ -47,7 +52,7 @@ const listenForPing = cb => rclient2.blpop("test-blpop", 200, function(error, re const PING_DELAY = 100; (sendPings = () => sendPing(() => setTimeout(sendPings, PING_DELAY)))(); -(listenInBackground = () => listenForPing(function(error, value) { +(listenInBackground = () => listenForPing((error, value) => { if (error) { console.error("[RECEIVING ERROR]", error.message); } return setTimeout(listenInBackground); }))(); diff --git a/services/document-updater/test/cluster_failover/coffee/test_pubsub_failover.js b/services/document-updater/test/cluster_failover/coffee/test_pubsub_failover.js index 295ffc5b7b..670c7afa3a 100644 --- a/services/document-updater/test/cluster_failover/coffee/test_pubsub_failover.js +++ b/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: * DS102: Remove unnecessary code created because of implicit returns @@ -19,7 +24,7 @@ const rclient2 = redis.createClient({cluster: [{ let counter = 0; const sendPing = function(cb) { 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)) { counter += 1; @@ -30,7 +35,7 @@ const sendPing = function(cb) { let previous = null; rclient2.subscribe("test-pubsub"); -rclient2.on("message", function(channel, value) { +rclient2.on("message", (channel, value) => { value = parseInt(value, 10); if ((value % 10) === 0) { console.log(".");