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 +4 -4
- data/lib/laximo.rb +21 -0
- data/lib/laximo/errors.rb +4 -1
- data/lib/laximo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8a737aafa2d30be961456c1d936edb4ec9efc61c5ac4c05844dd1d947038344e
|
|
4
|
+
data.tar.gz: 796f1bd2e0503348161828cfa3748d683757d3003062884a0b7f37aab32b7e54
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
data/lib/laximo/version.rb
CHANGED