mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-27 08:41:20 +00:00
decaffeinate: Run post-processing cleanups on expire_docops.coffee and 2 other files
This commit is contained in:
parent
5ad0b6eea2
commit
03cbad4e9f
3 changed files with 22 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}))();
|
||||
|
|
|
@ -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(".");
|
||||
|
|
Loading…
Reference in a new issue