-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TDL-18879: Clear offset when max_skip
error is encountered and return 0 if skip
is greater than 250k in the current state.
#29
base: master
Are you sure you want to change the base?
Changes from 1 commit
7848ba0
2add6aa
e6ef2be
451c435
a33f38b
5ce87fb
4a99c74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,6 +12,9 @@ | |||||
|
||||||
LOGGER = singer.get_logger() | ||||||
|
||||||
# default date date window size in days | ||||||
DATE_WINDOW_SIZE = 5 | ||||||
|
||||||
PATHS = { | ||||||
IDS.CUSTOM_FIELDS: "/custom_fields/lead/", | ||||||
IDS.LEADS: "/lead/", | ||||||
|
@@ -168,15 +171,15 @@ def sync_activities(ctx): | |||||
|
||||||
try: | ||||||
# get date window from config | ||||||
date_window = int(ctx.config.get("date_window", 15)) | ||||||
# if date_window is 0, '0' or None, then set default window size of 15 days | ||||||
date_window = int(ctx.config.get("date_window", DATE_WINDOW_SIZE)) | ||||||
# if date_window is 0, '0' or None, then set default window size of 5 days | ||||||
if not date_window: | ||||||
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 15 days.".format(ctx.config.get("date_window"))) | ||||||
date_window = 15 | ||||||
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 5 days.".format(ctx.config.get("date_window"))) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||||||
date_window = DATE_WINDOW_SIZE | ||||||
except ValueError: | ||||||
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 15 days.".format(ctx.config.get("date_window"))) | ||||||
LOGGER.warning("Invalid value of date window is passed: \'{}\', using default window size of 5 days.".format(ctx.config.get("date_window"))) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||||||
# In case of empty string(''), use default window | ||||||
date_window = 15 | ||||||
date_window = DATE_WINDOW_SIZE | ||||||
|
||||||
LOGGER.info("Using offset seconds {}".format(offset_secs)) | ||||||
start_date -= timedelta(seconds=offset_secs) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated