Skip to content

Extend code with limit check #461

@paczko

Description

@paczko

Is your feature request related to a problem? Please describe.
When executing the code sometime Bitfinex limitation (https://docs.bitfinex.com/docs/requirements-and-limitations) reached.
A logic need to be added when it happens and sleep for a time (60s) defined by Bitfinex.

Describe the solution you'd like
A logic like that would be nice to be added:

orig code:

    candle_data.extend(candlestick)
    write_to_console(
        ticker,
        interval,
        candlestick,
        live,
        setup_table(),
    )

..suggested code:

  if (len(candlestick) == 3):
      if  (candlestick[2] == 'ratelimit: error'):
          print('limit exceeded. sleep for 60s')
          sleep(60)
          continue
      break
  if len(candlestick) > 0:
    candle_data.extend(candlestick)
    write_to_console(
        ticker,
        interval,
        candlestick,
        live,
        setup_table(),
    )
  else:
    break

..the above suggested changes handles the situation if date is newer than latest data (even today added causes exception in code running)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions