hendt / ebay-api

eBay Node API in TypeScript for Node and Browser with RESTful and Traditional APIs. This library aims to implement all available eBay apis.
https://hendt.gitbook.io/ebay-api
MIT License
153 stars 41 forks source link

Error when calling getResultFile #143

Closed viandanteoscuro closed 1 year ago

viandanteoscuro commented 1 year ago

Hi,

I have to download a huge inventory file. Creation of task is ok, but when i perform che getResultFile with ebay.sell.feed.getResultFile i got this error:

node_modules\ebay-api\lib\errors\index.js:186 throw new EBayError(message, description, meta); ^

EBayError: aborted at handleEBayError (...node_modules\ebay-api\lib\errors\index.js:186:11) at Feed.request (...node_modules\ebay-api\lib\api\restful\index.js:167:42) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Feed.doRequest ... [Symbol(raw-error)]: <ref *2> Error: aborted at connResetException (node:internal/errors:691:14) at TLSSocket.socketCloseListener (node:_http_client:407:19) at TLSSocket.emit (node:events:402:35) at node:net:687:12 at TCP.done (node:_tls_wrap:580:7) { code: 'ECONNRESET',

So, i suppose there is a timout reached... Can i set a timeout in the api config? Thanks

Massimo

viandanteoscuro commented 1 year ago

Solution founded, sorry...

dantio commented 1 year ago

@viandanteoscuro Might you share the solution with us?

viandanteoscuro commented 1 year ago

Hi @dantio

I have added the header Keep-Alive with a high timeout.

eBay.sell.feed
  .api({
    headers: {
      Connection: 'Keep-Alive',
      'Keep-Alive': 'timeout=600, max=10',
    },
  })
  .getResultFile('task-id')
  .then((result) => {});