lib/fluent/plugin/in_feedly.rb in fluent-plugin-feedly-0.0.1 vs lib/fluent/plugin/in_feedly.rb in fluent-plugin-feedly-0.0.2

- old
+ new

@@ -53,11 +53,11 @@ @initial_loop = true loop do begin fetch rescue => e - log.error "Feedly: unexpected error has occoured.", :error => e.message, :error_class => e.class + log.error "Feedly: unexpected error has occoured.", error: e.message, error_class: e.class log.error_backtrace e.backtrace sleep @run_interval retry end sleep @run_interval @@ -69,13 +69,17 @@ category_id = "user/#{@profile_id}/category/#{category_name}" fetch_time_range = get_fetch_time_range loop { request_option = { count: @fetch_count, continuation: get_continuation_id, newerThan: fetch_time_range } cursor = @client.stream_entries_contents(category_id, request_option) + if cursor.items.nil? + log.error "Feedly: unexpected error has occoured.", cursor: cursor + break + end cursor.items.each do |item| Engine.emit(@tag, Engine.now, item) end - log.debug "Feedly: fetched articles.", articles: cursor.items.size, request_option: request_option + log.info "Feedly: fetched articles.", articles: cursor.items.size, request_option: request_option set_continuation_id(cursor.continuation) break if get_continuation_id.nil? } end end