Class: Relaton::Oasis::DataFetcher

Inherits:
Core::DataFetcher
  • Object
show all
Defined in:
lib/relaton/oasis/data_fetcher.rb

Constant Summary collapse

STANDARDS_URL =
"https://www.oasis-open.org/standards/".freeze
RETRIABLE_ERRORS =
[
  SocketError,
  Ferrum::TimeoutError,
  Ferrum::PendingConnectionsError,
  Ferrum::StatusError,
].freeze

Instance Method Summary collapse

Instance Method Details

#fetch(_source = nil) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/relaton/oasis/data_fetcher.rb', line 22

def fetch(_source = nil)
  doc = with_retry { agent.get(STANDARDS_URL) }
  doc.xpath("//details").map do |item|
    save_doc DataParser.new(item, @errors, agent: agent).parse
    fetch_parts item
  end
  index.save
  report_errors
ensure
  @agent&.quit
end

#log_error(msg) ⇒ Object



18
19
20
# File 'lib/relaton/oasis/data_fetcher.rb', line 18

def log_error(msg)
  Util.error msg
end