scrubdeku 0.0.5 → 0.0.6
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/SCRuB.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc7298334be1f71c79d812105af729641df56ca5
|
4
|
+
data.tar.gz: 2c1edeeee6ec92635efff5b8b12c30242a2d2e80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12a1ff33e5813857f150feef3e7a341b6ba2c4162fd3ccc4818b5ea05c23fcd6b89d30a071ab6baa16997531a090d72851e524a40f5c9c94ad64b92269b4a431
|
7
|
+
data.tar.gz: 30ae18b8bcc320eb63b047cfce375ce05ae532ef70cfd79f52344c12dce1f30ed79707b4c76145c5f54f39357c3fb4b361f91ec1f979d8f38d6998c123ce0cee
|
data/lib/SCRuB.rb
CHANGED
@@ -44,7 +44,7 @@ module Scrub
|
|
44
44
|
response = @inventoryClient.call(:product_warehouse_inventory_get, message: {'WarehouseID' => warehouseid, 'pageNumber' => page}).to_hash[:product_warehouse_inventory_get_response][:product_warehouse_inventory_get_result][:string]
|
45
45
|
rescue NoMethodError
|
46
46
|
[]
|
47
|
-
rescue Net::OpenTimeout
|
47
|
+
rescue Net::OpenTimeout, Errno::ECONNRESET
|
48
48
|
puts "Retrying..."
|
49
49
|
retry
|
50
50
|
end
|
@@ -61,7 +61,7 @@ module Scrub
|
|
61
61
|
def getSkuInventoryAllWarehouses(sku)
|
62
62
|
begin
|
63
63
|
response = self.generalRaw(:get_product_inventory_for_all_warehouses, {'ProductID' => sku})[:get_product_inventory_for_all_warehouses_response][:get_product_inventory_for_all_warehouses_result][:get_product_inventory_for_all_warehouses_response_type]
|
64
|
-
rescue Net::OpenTimeout
|
64
|
+
rescue Net::OpenTimeout, Errno::ECONNRESET
|
65
65
|
retry
|
66
66
|
end
|
67
67
|
end
|
@@ -70,8 +70,9 @@ module Scrub
|
|
70
70
|
inventory = {}
|
71
71
|
skus = skuTable.in_groups(threads)
|
72
72
|
lock = Mutex.new
|
73
|
+
threads = []
|
73
74
|
(0...threads).each do |i|
|
74
|
-
Thread.new do
|
75
|
+
threads << Thread.new do
|
75
76
|
threadTable = {}
|
76
77
|
skus[i].each do |sku|
|
77
78
|
puts "Getting data for #{sku}"
|
@@ -83,6 +84,7 @@ module Scrub
|
|
83
84
|
end
|
84
85
|
end
|
85
86
|
end
|
87
|
+
threads.each{|thr| thr.join}
|
86
88
|
return inventory
|
87
89
|
end
|
88
90
|
|