From 90e0b4b273d12a8af3b04b13fa69cb47558f28cf Mon Sep 17 00:00:00 2001 From: James Allen Date: Fri, 5 May 2017 13:36:39 +0100 Subject: [PATCH] Gracefully handle missing callback to exec in ioredis --- libraries/redis-wrapper/index.coffee | 4 ++-- libraries/redis-wrapper/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/redis-wrapper/index.coffee b/libraries/redis-wrapper/index.coffee index 5487bd52b2..aa6e43cb1f 100644 --- a/libraries/redis-wrapper/index.coffee +++ b/libraries/redis-wrapper/index.coffee @@ -61,8 +61,8 @@ module.exports = RedisSharelatex = client.multi = (args...) -> multi = _multi.call(client, args...) _exec = multi.exec - multi.exec = (args..., callback) -> - _exec.call multi, args..., (error, result) -> + multi.exec = (callback = () ->) -> + _exec.call multi, (error, result) -> # ioredis exec returns an results like: # [ [null, 42], [null, "foo"] ] # where the first entries in each 2-tuple are diff --git a/libraries/redis-wrapper/package.json b/libraries/redis-wrapper/package.json index 915ac0fcb3..2f47b8cd92 100644 --- a/libraries/redis-wrapper/package.json +++ b/libraries/redis-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "redis-sharelatex", - "version": "1.0.1", + "version": "1.0.2", "description": "Redis wrapper for node which will either use cluster, sentinal, or single instance redis", "main": "index.js", "author": "ShareLaTeX",