Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 34f57a9

Browse files
pslavovivanovyordan
authored andcommitted
Update counter logging - not so often
1 parent 88a3b5e commit 34f57a9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tap_postgres/sync_strategies/logical_replication.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
UPDATE_BOOKMARK_PERIOD = 1000
2323

24+
COUNTER_PRINT_PERIOD = 10000
25+
2426
COUNTER={'U': 0, 'D': 0, 'I': 0, 'json_load': 0, 'read_message': 0, 'send_message': 0}
2527

2628
def get_pg_version(cur):
@@ -471,8 +473,9 @@ def sync_tables(conn_info, logical_streams, state, end_lsn):
471473
#msg has been consumed. it has been processed
472474
last_lsn_processed = msg.data_start
473475
rows_saved = rows_saved + 1
474-
if rows_saved % UPDATE_BOOKMARK_PERIOD == 0:
476+
if rows_saved % COUNTER_PRINT_PERIOD == 0:
475477
LOGGER.info("Rows saved = %s, Processed messages counter: %s", str(rows_saved), str(COUNTER))
478+
if rows_saved % UPDATE_BOOKMARK_PERIOD == 0:
476479
singer.write_message(singer.StateMessage(value=copy.deepcopy(state)))
477480
else:
478481
now = datetime.datetime.now()

0 commit comments

Comments
 (0)