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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07dc44bc68ae6d83c97f0ab022954dd379b95ed4
4
- data.tar.gz: 5385bb75c6ca69a86679d793abe14fe239b46923
3
+ metadata.gz: 0df8cd9717d16faefbd1143cd03004946a06908e
4
+ data.tar.gz: 29143ff6ce6fed6a0935ebef61c8efb2797b6e9c
5
5
  SHA512:
6
- metadata.gz: 75d9130f3b7a639711c1fe1121e92a4b1a97ae2a31f7396f5f36ca623972e878924de8397b8287cca2b6050b09744b0c449383a2c1c828925b557b94606183b6
7
- data.tar.gz: 0b57bb28791728eaea2a322a19b7eed522eb3f0c1549995f64b6491f52f69b0f5432ddd9d7294977cc5f9d3b871408124144a3d39ddc9ae95f31b4d28436a185
6
+ metadata.gz: d39603975fb8360e03cdbcfe0627b27b91fd73de40fd8661def6302515f83c42454e587eb8b1984d57c4652ecd8d30b370a417a489b21a5b627a0671cb53ba48
7
+ data.tar.gz: 6fab720d088216d16d6c64c99b614b57bb6896d9f36b325872d466fdac0c105b7c7dcc1026908101a7ee7b64c881241f0db42431fadfa9ca2870e4c121b4f39d
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module Reso
2
- VERSION = "0.1.4.4"
2
+ VERSION = "0.1.4.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.4
4
+ version: 0.1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Edlund