Open JokerCatz opened 4 years ago
We had this problem while doing parallel requests to the rest API. It appears when requests arrive in different orders to the server.
We quick fixed by introducing a lock in our code to prevent parallel rest calls.
Eventually we could introduce this lock in the library. An other approach would be to change the API to async, the lib would push requests in order using a channel, a single go routine would make all rest calls, on response the library would trigger a callback specified by the caller.
https://github.com/bitfinexcom/bitfinex-api-go/blame/4d37e8d4be18f16ab50082b0c2c080542225f4a0/utils/nonce.go#L30
if I new the client obj every time , the nonce will be same of same "second" , the conn obj init nonce will be same ...
so I think just use nano second be nonce will fix this
or just fix source code , init conn nonce be nano second
but multi conn obj will be nonce collision ...
or use a global var + lock to increase it?