lib/dirty_pipeline/pg/storage.rb in dirty_pipeline-0.8.3 vs lib/dirty_pipeline/pg/storage.rb in dirty_pipeline-0.9.0
- old
+ new
@@ -57,10 +57,10 @@
VALUES ($1, $2, $3, $4)
ON CONFLICT (uuid)
DO UPDATE SET data = EXCLUDED.data, error = EXCLUDED.error;
SQL
def commit!(event)
- store["status"] = event.destination if event.destination
+ store["status"] = event.destination if event.success?
store["state"].merge!(event.changes) unless event.changes.to_h.empty?
data, error = {}, {}
data = event.data.to_h if event.data.respond_to?(:to_h)
error = event.error.to_h if event.error.respond_to?(:to_h)
with_postgres do |c|