File tree Expand file tree Collapse file tree
packages/sync-service/lib/electric/shapes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ defmodule Electric.Shapes.Consumer do
279279 { ShapeCache.Storage , :flushed , offset_in } ,
280280 % { write_unit: write_unit , pending_txn: pending_txn } = state
281281 )
282- when write_unit == :txn_fragment and not is_nil ( pending_txn ) do
282+ when is_write_unit_txn_fragment ( write_unit ) and not is_nil ( pending_txn ) do
283283 state = notify_flushed_mappings ( state , offset_in )
284284
285285 # Save the flushed offset for the current pending txn.
@@ -584,7 +584,7 @@ defmodule Electric.Shapes.Consumer do
584584 # With write_unit=txn all fragments are buffered until the Commit change is seen. At that
585585 # point, a transaction struct is produced from the buffered fragments and is written to
586586 # storage.
587- state . write_unit == State . write_unit_txn ( ) ->
587+ is_write_unit_txn ( state . write_unit ) ->
588588 { txns , transaction_builder } =
589589 TransactionBuilder . build ( txn_fragment , state . transaction_builder )
590590
Original file line number Diff line number Diff line change @@ -398,6 +398,6 @@ defmodule Electric.Shapes.Consumer.State do
398398 ]
399399 end
400400
401- def write_unit_txn , do: @ write_unit_txn
402- def write_unit_txn_fragment , do: @ write_unit_txn_fragment
401+ defguard is_write_unit_txn ( write_unit ) when write_unit == @ write_unit_txn
402+ defguard is_write_unit_txn_fragment ( write_unit ) when write_unit == @ write_unit_txn_fragment
403403end
You can’t perform that action at this time.
0 commit comments