From a8d48ad6625aaa85eaa3c3f8179a242a785760f0 Mon Sep 17 00:00:00 2001 From: "sam.braun" Date: Mon, 4 Nov 2019 14:20:23 -0500 Subject: [PATCH 1/3] adding a sleep to streams/base.py prevent rate limiting issues --- tap_chargebee/streams/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tap_chargebee/streams/base.py b/tap_chargebee/streams/base.py index 8dbccb8..0807ae9 100644 --- a/tap_chargebee/streams/base.py +++ b/tap_chargebee/streams/base.py @@ -1,4 +1,5 @@ import singer +import time from dateutil.parser import parse from tap_framework.streams import BaseStream @@ -107,6 +108,8 @@ def sync_data(self): LOGGER.info("Querying {} starting at {}".format(table, bookmark_date)) while not done: + # sleep for 30 seconds to prevent rate limiting + time.sleep(30) max_date = bookmark_date response = self.client.make_request( From 3cfee33606f8b008d194e52a911342ce8b3c3f86 Mon Sep 17 00:00:00 2001 From: "sam.braun" Date: Mon, 4 Nov 2019 14:20:23 -0500 Subject: [PATCH 2/3] adding a sleep to streams/base.py prevent rate limiting issues --- tap_chargebee/client.py | 2 ++ tap_chargebee/streams/base.py | 1 + 2 files changed, 3 insertions(+) diff --git a/tap_chargebee/client.py b/tap_chargebee/client.py index 3edde8d..1228ada 100644 --- a/tap_chargebee/client.py +++ b/tap_chargebee/client.py @@ -41,6 +41,8 @@ def make_request(self, url, method, params=None, base_backoff=15, if params is None: params = {} + # sleep for 2 seconds to prevent rate limiting + time.sleep(2) LOGGER.info("Making {} request to {}".format(method, url)) response = requests.request( diff --git a/tap_chargebee/streams/base.py b/tap_chargebee/streams/base.py index 8dbccb8..69f4a21 100644 --- a/tap_chargebee/streams/base.py +++ b/tap_chargebee/streams/base.py @@ -1,4 +1,5 @@ import singer +import time from dateutil.parser import parse from tap_framework.streams import BaseStream From 68533551adea6e6bbc4071485c4afb371ce48064 Mon Sep 17 00:00:00 2001 From: cptcret Date: Fri, 8 Nov 2019 15:34:33 -0500 Subject: [PATCH 3/3] Delete nop.yml --- nop.yml | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 nop.yml diff --git a/nop.yml b/nop.yml deleted file mode 100644 index 871441b..0000000 --- a/nop.yml +++ /dev/null @@ -1,45 +0,0 @@ -base_version: 0.1 -continuous_integration: - publish_build_artifacts: true -projects: - chargebee_to_snowflake: - style: python-tox - purpose: job - job: - # 6:00AM in NYC - schedule: "2017-08-15T10:00:00.000Z" - frequency: PT1H # Every 1 hour - timeout: 1200 - continuous_deployment: no - python: - command: chargebee_job - version: 3.7 - - hardware: - memory: 256 - cpu_units: 0.25 - instance_count: 1 - - credential_files: - main: - source: consumer/chargebee_stitch_job/stitch_api_credentials.json - dest: chargebee/stitch_api_credentials.json - - environments: - docker-local: null - classicqa-useast1-cd: - continuous_deployment: no - config_files: - configuration/chargebeejobs/config.yml: - loadPartial: true - classicqa-useast1: - continuous_deployment: no - config_files: - configuration/chargebeejobs/config.yml: - loadPartial: true - biggie-useast1: - continuous_deployment: no - config_files: - configuration/chargebeejobs/config.yml: - loadPartial: false -