reso 0.1.4.4 → 0.1.4.5
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/app/models/import.rb +6 -2
- data/lib/reso/version.rb +1 -1
- 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: 0df8cd9717d16faefbd1143cd03004946a06908e
|
4
|
+
data.tar.gz: 29143ff6ce6fed6a0935ebef61c8efb2797b6e9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d39603975fb8360e03cdbcfe0627b27b91fd73de40fd8661def6302515f83c42454e587eb8b1984d57c4652ecd8d30b370a417a489b21a5b627a0671cb53ba48
|
7
|
+
data.tar.gz: 6fab720d088216d16d6c64c99b614b57bb6896d9f36b325872d466fdac0c105b7c7dcc1026908101a7ee7b64c881241f0db42431fadfa9ca2870e4c121b4f39d
|
data/app/models/import.rb
CHANGED
@@ -47,7 +47,7 @@ class Import < ActiveRecord::Base
|
|
47
47
|
self.update_attribute(:status, :running)
|
48
48
|
source_data_modified = self.source_url_last_modified
|
49
49
|
|
50
|
-
l, count, found_listing_keys, stream = 0, 0, [], ''
|
50
|
+
l, count, found_listing_keys, snapshots, stream = 0, 0, [], [], ''
|
51
51
|
open_tag, close_tag = get_open_and_closing_tag_for self.repeating_element
|
52
52
|
|
53
53
|
# Grab a file to work with
|
@@ -66,6 +66,10 @@ class Import < ActiveRecord::Base
|
|
66
66
|
doc = Nokogiri::XML([xml_header, xml].join).remove_namespaces!
|
67
67
|
found_listing_keys << create_queued_listing_and_return_listing_key(doc, self)
|
68
68
|
stream.gsub!(xml, '')
|
69
|
+
if ((l += 1) % 100).zero?
|
70
|
+
GC.start
|
71
|
+
snapshots << [l, ] l/(Time.now - start_time)
|
72
|
+
end
|
69
73
|
end
|
70
74
|
end
|
71
75
|
end_time = Time.now
|
@@ -87,7 +91,7 @@ class Import < ActiveRecord::Base
|
|
87
91
|
end
|
88
92
|
|
89
93
|
def download_feed_to_import import
|
90
|
-
filename = import.source_url.split('/').last
|
94
|
+
filename = [Time.now.to_s.parameterize, import.source_url.split('/').last].join
|
91
95
|
filepath = Rails.root.join('tmp', filename).to_s
|
92
96
|
File.delete(filepath) if File.file? filepath
|
93
97
|
open(filepath, 'wb') do |file|
|
data/lib/reso/version.rb
CHANGED