Make Geo::EventStore#create simpler

parent 59906167
...@@ -31,11 +31,7 @@ module Geo ...@@ -31,11 +31,7 @@ module Geo
def create def create
return unless Gitlab::Geo.primary? return unless Gitlab::Geo.primary?
Geo::EventLog.transaction do Geo::EventLog.create!("#{self.class.event_type}" => build_event)
event_log = Geo::EventLog.new
event_log.public_send("#{self.class.event_type}=", build_event)
event_log.save!
end
rescue ActiveRecord::RecordInvalid, NoMethodError rescue ActiveRecord::RecordInvalid, NoMethodError
log("#{self.event_type.to_s.humanize} could not be created") log("#{self.event_type.to_s.humanize} could not be created")
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment