Skip to content

Commit

Permalink
Small code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Grondin committed Aug 20, 2018
1 parent e7d9fe4 commit 967ce90
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
8 changes: 2 additions & 6 deletions bottleneck.js
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a

// Generated by CoffeeScript 2.2.4
(function () {
var BottleneckError, IORedisConnection, RedisConnection, RedisDatastore, Scripts, parser;
var BottleneckError, IORedisConnection, RedisConnection, RedisDatastore, parser;

parser = require("./parser");

Expand All @@ -1325,8 +1325,6 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a

IORedisConnection = require("./IORedisConnection");

Scripts = require("./Scripts");

RedisDatastore = class RedisDatastore {
constructor(instance, initSettings, options) {
this.instance = instance;
Expand Down Expand Up @@ -1368,11 +1366,9 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
}

runScript(name, args) {
var keys;
if (!this.isReady) {
return this.Promise.reject(new BottleneckError("This limiter is not done connecting to Redis yet. Wait for the '.ready()' promise to resolve before submitting requests."));
} else {
keys = Scripts.keys(name, this.originalId);
return new this.Promise((resolve, reject) => {
var arr;
this.instance.Events.trigger("debug", [`Calling Redis script: ${name}.lua`, args]);
Expand Down Expand Up @@ -1557,7 +1553,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a

module.exports = RedisDatastore;
}).call(undefined);
},{"./BottleneckError":2,"./IORedisConnection":6,"./RedisConnection":8,"./Scripts":10,"./parser":15}],10:[function(require,module,exports){
},{"./BottleneckError":2,"./IORedisConnection":6,"./RedisConnection":8,"./parser":15}],10:[function(require,module,exports){
"use strict";

// Generated by CoffeeScript 2.2.4
Expand Down
2 changes: 1 addition & 1 deletion bottleneck.min.js

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions lib/RedisDatastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a

// Generated by CoffeeScript 2.2.4
(function () {
var BottleneckError, IORedisConnection, RedisConnection, RedisDatastore, Scripts, parser;
var BottleneckError, IORedisConnection, RedisConnection, RedisDatastore, parser;

parser = require("./parser");

Expand All @@ -16,8 +16,6 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a

IORedisConnection = require("./IORedisConnection");

Scripts = require("./Scripts");

RedisDatastore = class RedisDatastore {
constructor(instance, initSettings, options) {
this.instance = instance;
Expand Down Expand Up @@ -59,11 +57,9 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
}

runScript(name, args) {
var keys;
if (!this.isReady) {
return this.Promise.reject(new BottleneckError("This limiter is not done connecting to Redis yet. Wait for the '.ready()' promise to resolve before submitting requests."));
} else {
keys = Scripts.keys(name, this.originalId);
return new this.Promise((resolve, reject) => {
var arr;
this.instance.Events.trigger("debug", [`Calling Redis script: ${name}.lua`, args]);
Expand Down
2 changes: 0 additions & 2 deletions src/RedisDatastore.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ parser = require "./parser"
BottleneckError = require "./BottleneckError"
RedisConnection = require "./RedisConnection"
IORedisConnection = require "./IORedisConnection"
Scripts = require "./Scripts"

class RedisDatastore
constructor: (@instance, @initSettings, options) ->
Expand Down Expand Up @@ -33,7 +32,6 @@ class RedisDatastore
runScript: (name, args) ->
if !@isReady then @Promise.reject new BottleneckError "This limiter is not done connecting to Redis yet. Wait for the '.ready()' promise to resolve before submitting requests."
else
keys = Scripts.keys name, @originalId
new @Promise (resolve, reject) =>
@instance.Events.trigger "debug", ["Calling Redis script: #{name}.lua", args]
arr = @connection.scriptArgs name, @originalId, args, (err, replies) ->
Expand Down
2 changes: 1 addition & 1 deletion test/ioredis.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (process.env.DATASTORE === 'ioredis') {
c.limiter.disconnect(false)
})

it('Should connect in Redis Cluter mode', function () {
it('Should connect in Redis Cluster mode', function () {
c = makeTest({
maxConcurrent: 2,
clientOptions: {},
Expand Down

0 comments on commit 967ce90

Please sign in to comment.