Skip to content

Commit

Permalink
fix(crawler): flush the logging output
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerska committed May 17, 2016
1 parent 560e507 commit 2d9c1d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 4 additions & 0 deletions crawler/crawler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ def get type, obj
alias_method :set, :get

def crawl type
count = ZendeskAPI::CLIENT.send(type.plural).count
i = 0
ZendeskAPI::CLIENT.send(type.plural).all do |obj|
set type, obj
puts "#{type.plural.capitalize}: #{i += 1}/#{count}"
STDOUT.flush
end
end

Expand Down
5 changes: 0 additions & 5 deletions crawler/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ def initialize crawler, obj # Or object id, see fetch
@crawler = crawler
@zendesk_obj = fetch(obj)
@data = build
if @zendesk_obj.nil?
puts "Not-existing object #{self.class.plural}:#{obj}"
else
puts "New #{self.class.plural}:#{@zendesk_obj.id}"
end
end

def build
Expand Down

0 comments on commit 2d9c1d7

Please sign in to comment.