Class: Eventosaurus::Persistors::Synchronous

Inherits:
Object
  • Object
show all
Defined in:
lib/eventosaurus/persistors/synchronous.rb

Class Method Summary collapse

Class Method Details

.persist(klass_name, item) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/eventosaurus/persistors/synchronous.rb', line 4

def self.persist(klass_name, item)
  klass = klass_name.constantize
  klass.put_item(item)

rescue Aws::DynamoDB::Errors::ConditionalCheckFailedException => e
  # This must be a double submit. Log it just in case.
  Eventosaurus.configuration.logger.info(
    "Duplicate UUID sent to DynamoDB. Details: #{item}. Error: #{e}"
  )
end