tiagosiebler / bybit-api

Node.js SDK for the Bybit APIs and WebSockets, with TypeScript & browser support.
https://www.npmjs.com/package/bybit-api
MIT License
244 stars 80 forks source link

Process remains running after REST API call finished #126

Closed doppelgunner closed 2 years ago

doppelgunner commented 2 years ago

is there any option i need to pass? it seems like the console is still running even after the excution

const client = new LinearClient( API_KEY, PRIVATE_KEY, useLivenet, );

client.getSymbols().then(res => { const symbol = "BTCUSDT"; const data = _.find(res.result, r => r.name == symbol) console.log('data', data) })

tiagosiebler commented 2 years ago

7th March 2023

Time sync is disabled by default for quite some time now. If time sync is enabled, an interval timer will be used to regularly poll bybit's REST time endpoint. This is usually what would prevent the process from closing after your REST calls are done.

Generally I would not recommend to enable the time sync feature, especially if you're making short-lived executions and only expect the process to last a short amount of time. Instead, ensure your system clock is correctly set (e.g. using a time service via ntp).