laximo 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cacc00471ede611432dc15745875f5e18ff732c7ad994d1d452bc02e8a15b71
4
- data.tar.gz: d9e164e4731574ba8ad9cb66b8e4200006f82ae3c25127d85496b9ad6328a6f1
3
+ metadata.gz: 8a737aafa2d30be961456c1d936edb4ec9efc61c5ac4c05844dd1d947038344e
4
+ data.tar.gz: 796f1bd2e0503348161828cfa3748d683757d3003062884a0b7f37aab32b7e54
5
5
  SHA512:
6
- metadata.gz: c9d9a945a7f54a5685b2f6a6fc59ea8af650a9acdcc7f862d089efb2e6998e5427f5e5840eb6d08a4fbd1f0f26826796ac68b83b43ff7dcf8e46be937f5261ff
7
- data.tar.gz: 2f2db60f46f812088ada643c7fdbc48e972c5294fe35ad89ffcd9596362515b1ed8923510c9edd35289e3319a0406b4f47bd7bbabc9582ba845ee7dc8b2e8362
6
+ metadata.gz: 88b03e1a69e56827e3589573f35999fa5d125c7c763b323418d1e06c837aed0e898331649c061363be93138e9e039ff1a1035cd6934e77d2ce3dd38602d798ba
7
+ data.tar.gz: e939914757ed7b5e8df33a8dbca862d15a815d18a8a39007187cbc521d8ebdf5832befbe7ea3b0ae39d29a707866222a043e02692d521efc311962df269c9559
data/lib/laximo.rb CHANGED
@@ -36,6 +36,27 @@ module Laximo
36
36
  ::Laximo::Oem.new
37
37
  end
38
38
 
39
+ def tryer(try_iter: 5, time: 25)
40
+
41
+ begin
42
+
43
+ cl = caller_locations(1,1).first
44
+ yield
45
+
46
+ rescue ::Laximo::SoapTooManyRequestError
47
+
48
+ try_iter = try_iter - 1
49
+
50
+ puts "[#{cl}] Waiting #{time} sec..."
51
+ sleep time
52
+
53
+ retry if try_iter > 0
54
+ raise
55
+
56
+ end
57
+
58
+ end
59
+
39
60
  def deprecated!
40
61
 
41
62
  puts "***"
data/lib/laximo/errors.rb CHANGED
@@ -21,6 +21,8 @@ module Laximo
21
21
 
22
22
  class SoapGroupIsNotSearchableError < ::Laximo::Error; end
23
23
 
24
+ class SoapTooManyRequestError < ::Laximo::Error; end
25
+
24
26
  ERRORS = {
25
27
 
26
28
  'E_CATALOGNOTEXISTS' => SoapCatalogNotExistsError,
@@ -29,7 +31,8 @@ module Laximo
29
31
  'E_UNKNOWNCOMMAND' => SoapUnknownCommandError,
30
32
  'E_ACCESSDENIED' => SoapAccessDeniedError,
31
33
  'E_NOTSUPPORTED' => SoapNotSupportedError,
32
- 'E_GROUP_IS_NOT_SEARCHABLE' => SoapGroupIsNotSearchableError
34
+ 'E_GROUP_IS_NOT_SEARCHABLE' => SoapGroupIsNotSearchableError,
35
+ 'E_TOO_MANY_REQUESTS' => SoapTooManyRequestError
33
36
 
34
37
  }.freeze
35
38
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Laximo
3
3
 
4
- VERSION = '0.9.1'.freeze
4
+ VERSION = '0.9.2'.freeze
5
5
 
6
6
  end # Laximo
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: laximo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Pilyaev