asyncapi-client 0.6.0 → 0.6.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: 2c4aa942b90ab8794c0eaeb572810d4277581df5
4
- data.tar.gz: 186bd9cf4144c883d8f532e18caa8bd5143c2755
3
+ metadata.gz: 0442d58b1fef76db35a72610d36c252e436bd87e
4
+ data.tar.gz: ae995558fb784a1ae4bb32ec00b3f95282d211a2
5
5
  SHA512:
6
- metadata.gz: 6553230b72635076b4fee02bb0a47fd04b50821c6ddae57f3819bc353f33289c151eadbfe5fbcd8be0a58cb8e36f07d28209e7684ffee3aef7c6c82876c5e1a1
7
- data.tar.gz: a4358536d0282459c8830a2009b761d60d008ea5dfdfa6c7be598edd75c5effa8629b18ccfd583c18f323b24974c2beedbeab90caf94c4a6c28f065e0e66ed0a
6
+ metadata.gz: e0a4cdb9e08a98843411f0e02e12a7e5e0246e7d0248ea4234c3dedba85169cbbe84cb5dff1796459a3203b772c78bd4d7787703b187003fb8707ab8fc599296
7
+ data.tar.gz: 71c2c8dec236313c1794125c4e96137b7533c0bae0f0ca374e820d16b1c38a0a7c427584c30dfebb6b5c4c6c059144501fba0d5315e8c6a0f9341aa7a8770742
data/README.md CHANGED
@@ -156,7 +156,7 @@ require "asyncapi/client/factories"
156
156
  # Development
157
157
 
158
158
  ```
159
- rake app:db:schema:load
159
+ rake db:migrate && rake db:migrate RAILS_ENV=test
160
160
  rspec spec
161
161
  ```
162
162
 
@@ -70,7 +70,9 @@ module Asyncapi::Client
70
70
  }
71
71
  args[:time_out_at] = time_out.from_now if time_out
72
72
  job = create(args)
73
- JobPostWorker.perform_async(job.id, url)
73
+ ActiveRecord::Base.after_transaction do
74
+ JobPostWorker.perform_async(job.id, url)
75
+ end
74
76
  end
75
77
 
76
78
  def url
@@ -9,7 +9,9 @@ module Asyncapi::Client
9
9
  if may_transition?(job, to: status)
10
10
  transition(job, to: status)
11
11
  if job.status_changed? && job.save
12
- JobStatusWorker.perform_async(job.id)
12
+ ActiveRecord::Base.after_transaction do
13
+ JobStatusWorker.perform_async(job.id)
14
+ end
13
15
  else
14
16
  job.save
15
17
  end
@@ -21,12 +21,16 @@ module Asyncapi::Client
21
21
  job.assign_attributes(job_params_from(response))
22
22
  job.enqueue
23
23
  if job.save!
24
- JobStatusWorker.perform_async(job.id)
24
+ ActiveRecord::Base.after_transaction do
25
+ JobStatusWorker.perform_async(job.id)
26
+ end
25
27
  end
26
28
  else
27
29
  job.fail_queue
28
30
  if job.update_attributes!(message: response.body, response_code: response.response_code)
29
- JobStatusWorker.perform_async(job.id)
31
+ ActiveRecord::Base.after_transaction do
32
+ JobStatusWorker.perform_async(job.id)
33
+ end
30
34
  end
31
35
  end
32
36
  end
@@ -13,7 +13,9 @@ module Asyncapi::Client
13
13
 
14
14
  def time_out_job(job)
15
15
  job.update_attributes(status: :timed_out)
16
- JobStatusWorker.perform_async(job.id)
16
+ ActiveRecord::Base.after_transaction do
17
+ JobStatusWorker.perform_async(job.id)
18
+ end
17
19
  end
18
20
 
19
21
  end
@@ -3,6 +3,7 @@ require "sidekiq-cron"
3
3
  require "api-pagination"
4
4
  require "typhoeus"
5
5
  require 'aasm'
6
+ require 'ar_after_transaction'
6
7
  require "asyncapi/client/engine"
7
8
  require "securerandom"
8
9
 
@@ -1,5 +1,5 @@
1
1
  module Asyncapi
2
2
  module Client
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asyncapi-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - G5
@@ -10,20 +10,20 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-05-26 00:00:00.000000000 Z
13
+ date: 2016-08-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '4.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: '4.0'
29
29
  - !ruby/object:Gem::Dependency
@@ -110,6 +110,20 @@ dependencies:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: '4.0'
113
+ - !ruby/object:Gem::Dependency
114
+ name: ar_after_transaction
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :runtime
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
113
127
  - !ruby/object:Gem::Dependency
114
128
  name: sqlite3
115
129
  requirement: !ruby/object:Gem::Requirement
@@ -280,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
294
  version: '0'
281
295
  requirements: []
282
296
  rubyforge_project:
283
- rubygems_version: 2.5.1
297
+ rubygems_version: 2.6.4
284
298
  signing_key:
285
299
  specification_version: 4
286
300
  summary: Asynchronous API communication