Module: DiasporaFederation::Federation::Fetcher

Defined in:
lib/diaspora_federation/federation/fetcher.rb

Overview

This module is for fetching entities from other pods.

Defined Under Namespace

Classes: NotFetchable

Class Method Summary collapse

Class Method Details

.fetch_public(author, entity_type, guid) ⇒ Object

Fetches a public entity from a remote pod

Raises:


10
11
12
13
14
15
16
# File 'lib/diaspora_federation/federation/fetcher.rb', line 10

def self.fetch_public(author, entity_type, guid)
  type = entity_name(entity_type).to_s
  raise "Already fetching ..." if fetching[type].include?(guid)
  fetch_from_url(author, type, guid)
rescue => e # rubocop:disable Style/RescueStandardError
  raise NotFetchable, "Failed to fetch #{entity_type}:#{guid} from #{author}: #{e.class}: #{e.message}"
end