diff --git a/lendingbot.py b/lendingbot.py index 00f6be30..179b795e 100755 --- a/lendingbot.py +++ b/lendingbot.py @@ -146,7 +146,7 @@ def new_getaddrinfo(*urlargs): log.log_error('IP has been banned due to many requests. Sleeping for {} seconds'.format(sum_sleep)) if Config.has_option('MarketAnalysis', 'analyseCurrencies'): if api.req_period <= api.default_req_period * 1.5: - api.req_period += 3 + api.req_period += 1000 if Config.getboolean('MarketAnalysis', 'ma_debug_log'): print("Caught ERR_RATE_LIMIT, sleeping capture and increasing request delay. Current" " {0}ms".format(api.req_period)) diff --git a/modules/Bitfinex.py b/modules/Bitfinex.py index ebf151ba..9ec0a101 100644 --- a/modules/Bitfinex.py +++ b/modules/Bitfinex.py @@ -20,7 +20,7 @@ def __init__(self, cfg, log): self.log = log self.lock = threading.RLock() self.req_per_period = 1 - self.default_req_period = 1000 # milliseconds, 1000 = 60/min + self.default_req_period = 5000 # milliseconds, 1000 = 60/min self.req_period = self.default_req_period self.req_time_log = RingBuffer(self.req_per_period) self.url = 'https://api.bitfinex.com' diff --git a/modules/ExchangeApi.py b/modules/ExchangeApi.py index 939c8bee..ce0570cc 100644 --- a/modules/ExchangeApi.py +++ b/modules/ExchangeApi.py @@ -52,8 +52,8 @@ def limit_request_rate(self): @abc.abstractmethod def increase_request_timer(self): - if self.req_period <= self.default_req_period * 1.5: - self.req_period += 3 + if self.req_period <= self.default_req_period * 3.0: + self.req_period += 500 @abc.abstractmethod def decrease_request_timer(self): diff --git a/modules/MarketAnalysis.py b/modules/MarketAnalysis.py index 05ff8321..0fe7ed98 100644 --- a/modules/MarketAnalysis.py +++ b/modules/MarketAnalysis.py @@ -83,6 +83,7 @@ def __init__(self, config, api): except Exception as cur_ex: raise Exception("ERROR: You entered an incorrect currency: '{0}' to analyse the market of, please " "check your settings. Error message: {1}".format(currency, cur_ex)) + time.sleep(2) def run(self): """ @@ -182,6 +183,7 @@ def update_market_thread(self, cur, levels=None): market_data.append("0.1") market_data.append('0') # Percentile field not being filled yet. self.insert_into_db(db_con, market_data) + time.sleep(5) def insert_into_db(self, db_con, market_data, levels=None): if levels is None: diff --git a/plugins/Charts.py b/plugins/Charts.py index 70f0a1c7..7f9a90b3 100644 --- a/plugins/Charts.py +++ b/plugins/Charts.py @@ -31,6 +31,7 @@ def before_lending(self): def after_lending(self): if self.get_db_version() > 0 and self.last_dump + self.dump_interval < sqlite3.time.time(): + self.log.log("Dumping Charts Data") self.dump_history() self.last_dump = sqlite3.time.time()