async-rails 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cea5f2910562d097102fd9945aa7eb2246cdb7de
4
- data.tar.gz: c99ba64dd344ad7dff32effba4b6c5ee1e687602
3
+ metadata.gz: '08e5cb75601fccd33a0d462ab6785d14db141f29'
4
+ data.tar.gz: eaf38a840d3aceb791c3b932c45a3c402853c00a
5
5
  SHA512:
6
- metadata.gz: 140ee493acbb4b0f3731e63ed3740ac7001c3c31af33101878dd92265cac774b9e24175ae6e2591cd1a9eeb453251db2c755517d76c6d13d4cf2f8ee16b0e340
7
- data.tar.gz: 73373fc59cd003760869e372a20ebce34a1d8fcbbbe29243b5696349b1c628d5cf59063d5aac022a72711babcd208a96a7f4747c67e2ea60365896813c2611b8
6
+ metadata.gz: 0207565ddaee5781e7de430a6c4263a469ee1416b5d450ee6f7d3d9bb5ee9af964e9d191512cfe4c43d794e8f549762d720448f1336eae2c6b80858124582173
7
+ data.tar.gz: 95bcac0ca71e890834604b876128d160ae1e879665253e66b0fb91ba21f77cf4415e3872689aa90e50f6416ef005a92d0df0394e7c74200e2304b4b9828257d8
@@ -1,5 +1,5 @@
1
1
  module Async
2
2
  module Rails
3
- VERSION = "2.4.0"
3
+ VERSION = "2.4.1"
4
4
  end
5
5
  end
@@ -4868,34 +4868,33 @@ function sortBy (coll, iteratee, callback) {
4868
4868
  * });
4869
4869
  */
4870
4870
  function timeout(asyncFn, milliseconds, info) {
4871
- var originalCallback, timer;
4872
- var timedOut = false;
4873
-
4874
- function injectedCallback() {
4875
- if (!timedOut) {
4876
- originalCallback.apply(null, arguments);
4877
- clearTimeout(timer);
4878
- }
4879
- }
4871
+ var fn = wrapAsync(asyncFn);
4880
4872
 
4881
- function timeoutCallback() {
4882
- var name = asyncFn.name || 'anonymous';
4883
- var error = new Error('Callback function "' + name + '" timed out.');
4884
- error.code = 'ETIMEDOUT';
4885
- if (info) {
4886
- error.info = info;
4873
+ return initialParams(function (args, callback) {
4874
+ var timedOut = false;
4875
+ var timer;
4876
+
4877
+ function timeoutCallback() {
4878
+ var name = asyncFn.name || 'anonymous';
4879
+ var error = new Error('Callback function "' + name + '" timed out.');
4880
+ error.code = 'ETIMEDOUT';
4881
+ if (info) {
4882
+ error.info = info;
4883
+ }
4884
+ timedOut = true;
4885
+ callback(error);
4887
4886
  }
4888
- timedOut = true;
4889
- originalCallback(error);
4890
- }
4891
4887
 
4892
- var fn = wrapAsync(asyncFn);
4888
+ args.push(function () {
4889
+ if (!timedOut) {
4890
+ callback.apply(null, arguments);
4891
+ clearTimeout(timer);
4892
+ }
4893
+ });
4893
4894
 
4894
- return initialParams(function (args, origCallback) {
4895
- originalCallback = origCallback;
4896
4895
  // setup timer and call original function
4897
4896
  timer = setTimeout(timeoutCallback, milliseconds);
4898
- fn.apply(null, args.concat(injectedCallback));
4897
+ fn.apply(null, args);
4899
4898
  });
4900
4899
  }
4901
4900
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-05 00:00:00.000000000 Z
11
+ date: 2017-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties