lib/grumlin/repository/instance_methods.rb in grumlin-0.19.0 vs lib/grumlin/repository/instance_methods.rb in grumlin-0.19.1
- old
+ new
@@ -62,12 +62,12 @@
# vertices:
# [["label", "id", {create: :properties}, {update: properties}]]
# params can override Retryable config from UPSERT_RETRY_PARAMS
def upsert_vertices(vertices, batch_size: 100, on_failure: :retry, **params)
- with_upsert_error_handling(on_failure, params) do
- vertices.each_slice(batch_size) do |slice|
+ vertices.each_slice(batch_size) do |slice|
+ with_upsert_error_handling(on_failure, params) do
slice.reduce(g) do |t, (label, id, create_properties, update_properties)|
create_properties, update_properties = cleanup_properties(create_properties, update_properties)
t.upsertV(label, id, create_properties, update_properties)
end.iterate
@@ -86,11 +86,11 @@
# edges:
# [["label", "id", {create: :properties}, {update: properties}]]
# params can override Retryable config from UPSERT_RETRY_PARAMS
def upsert_edges(edges, batch_size: 100, on_failure: :retry, **params)
- with_upsert_error_handling(on_failure, params) do
- edges.each_slice(batch_size) do |slice|
+ edges.each_slice(batch_size) do |slice|
+ with_upsert_error_handling(on_failure, params) do
slice.reduce(g) do |t, (label, from, to, create_properties, update_properties)|
create_properties, update_properties = cleanup_properties(create_properties, update_properties, T.label)
t.upsertE(label, from, to, create_properties, update_properties)
end.iterate