class Storage::Algolia::Actions::Get
Constants
- MAX_RETRIES
Attributes
id[R]
model_name[R]
retries[R]
Public Class Methods
new(model_name:, id:)
click to toggle source
# File lib/storage/algolia/actions/get.rb, line 13 def initialize(model_name:, id:) @model_name = model_name @id = id @retries = 0 end
Public Instance Methods
process()
click to toggle source
# File lib/storage/algolia/actions/get.rb, line 19 def process @retries += 1 normalize index.get_object(id).deep_transform_keys(&:to_sym) rescue => e pp "Retrying (#{@retries}/#{MAX_RETRIES})..." sleep 2 retry if @retries <= MAX_RETRIES raise Exception end