asynchronic 1.6.2 → 1.6.3

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: 1a894f32132a0a511bd83773c446ce495de49f44
4
- data.tar.gz: 9b6702827151e7bc0ade84a66edd372122a92f8c
3
+ metadata.gz: d090602f5e7db3b74e67c5057d7aec4761c2007e
4
+ data.tar.gz: b2e6ce2ff2d236510a71d91d7d5e0042179e4a64
5
5
  SHA512:
6
- metadata.gz: 56a7b05b1cd4bf276d1793c91fee9a4cdbb2832ac6605369e23c8ab123a258f4e13023ba30544dae38bf33d6833ea8ca91018da98995a7f1b130acd6bc7baa2b
7
- data.tar.gz: 0a354c88eef225439e81a0ac3ee659cb733aa7f74a1d6550f686b4410a2a7a0b5b964b195872ea4778777885ba147e91619faea17ea2609b0ae7c568fa25e338
6
+ metadata.gz: dd1f22974965986b3ce74f2187edf7ad7911bee32562871a7591cea31a93fa22187beaa8b3e1fcf416a09560585460c51557669cc07c067eed6007d31d7959ed
7
+ data.tar.gz: 1a8db5dddd1501792e2bc00cfe57be14b0ef0c8f6e44d8c29a77c03bb0ce0f80d0cda483f87b84703f474a245e3bed611909e2496e0fc44e444cebca6b1bab82
@@ -196,7 +196,7 @@ module Asynchronic
196
196
  job.before_finalize if [:completed, :aborted].include?(status) && job.respond_to?(:before_finalize)
197
197
  self.status = status
198
198
  rescue Exception => exception
199
- self.error = Error.new exception
199
+ self.error = Error.new exception unless error
200
200
  self.status = :aborted
201
201
  end
202
202
  end
@@ -1,3 +1,3 @@
1
1
  module Asynchronic
2
- VERSION = '1.6.2'
2
+ VERSION = '1.6.3'
3
3
  end
@@ -385,7 +385,6 @@ class BeforeFinalizeAbortedJob < Asynchronic::Job
385
385
  end
386
386
 
387
387
  class BeforeFinalizeRaisesExceptionJob < Asynchronic::Job
388
-
389
388
  def call
390
389
  nil
391
390
  end
@@ -393,5 +392,14 @@ class BeforeFinalizeRaisesExceptionJob < Asynchronic::Job
393
392
  def before_finalize
394
393
  raise 'Before finalize exception'
395
394
  end
395
+ end
396
+
397
+ class BeforeFinalizeExceptionOnAbortedJob < Asynchronic::Job
398
+ def call
399
+ raise 'Job error'
400
+ end
396
401
 
397
- end
402
+ def before_finalize
403
+ raise 'Before finalize error'
404
+ end
405
+ end
@@ -708,4 +708,23 @@ module LifeCycleExamples
708
708
  queue.must_be_empty
709
709
  end
710
710
 
711
+ it 'Before finalize raises exception on aborted job' do
712
+ process = create BeforeFinalizeExceptionOnAbortedJob
713
+
714
+ process.must_be_initialized
715
+ queue.must_be_empty
716
+
717
+ process.enqueue
718
+
719
+ process.must_be_queued
720
+ queue.must_enqueued process
721
+
722
+ execute queue
723
+
724
+ process.must_be_aborted
725
+ process.real_error.must_equal 'Job error'
726
+ queue.must_be_empty
727
+ end
728
+
729
+
711
730
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asynchronic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-31 00:00:00.000000000 Z
11
+ date: 2019-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis