Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Better error avoidance (#32)
Browse files Browse the repository at this point in the history
* include parsing state_file in try block
* bump version
  • Loading branch information
louis-pie authored Nov 11, 2019
1 parent 43abbe4 commit e7348f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
long_description = f.read()

setup(name='pipelinewise-tap-postgres',
version='1.2.0',
version='1.2.1',
description='Singer.io tap for extracting data from PostgreSQL - PipelineWise compatible',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
5 changes: 2 additions & 3 deletions tap_postgres/sync_strategies/logical_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,9 @@ def sync_tables(conn_info, logical_streams, state, end_lsn, state_file):
LOGGER.info("{} : Last wal message received was {} at {}".format(datetime.datetime.utcnow(), int_to_lsn(lsn_last_processed), lsn_received_timestamp))
try:
state_comitted_file = open(state_file)
except:
LOGGER.warning("{} : Unable to open {}".format(datetime.datetime.utcnow(), state_file))
else:
state_comitted = json.load(state_comitted_file)
except:
LOGGER.warning("{} : Unable to open and parse {}".format(datetime.datetime.utcnow(), state_file))
finally:
lsn_comitted = min([get_bookmark(state_comitted, s['tap_stream_id'], 'lsn') for s in logical_streams])
lsn_to_flush = lsn_comitted
Expand Down

0 comments on commit e7348f3

Please sign in to comment.