Class: Diaspora::Fetcher::Public

Inherits:
Object
  • Object
show all
Defined in:
lib/diaspora/fetcher/public.rb

Constant Summary collapse

Status_Initial =

various states that can be assigned to a person to describe where in the process of fetching their public posts we're currently at

0
Status_Running =
1
Status_Fetched =
2
Status_Processed =
3
Status_Done =
4
Status_Failed =
5
Status_Unfetchable =
6

Instance Method Summary collapse

Instance Method Details

#fetch!(diaspora_id) ⇒ Object

perform all actions necessary to fetch the public posts of a person with the given diaspora_id


18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/diaspora/fetcher/public.rb', line 18

def fetch! diaspora_id
  @person = Person. diaspora_id
  return unless qualifies_for_fetching?

  begin
    retrieve_and_process_posts
  rescue => e
    set_fetch_status Public::Status_Failed
    raise e
  end

  set_fetch_status Public::Status_Done
end