AndreyMashukov / go-crypto-bot

Multithread crypto bot implemented on Golang
MIT License
32 stars 11 forks source link

Separate logic for last price saving and history writing #49

Closed AndreyMashukov closed 4 months ago

AndreyMashukov commented 4 months ago

https://github.com/AndreyMashukov/go-crypto-bot/blob/d1773242a95e96bbff41c00cbaffc74fd8c86c09/src/repository/exhange_repository.go#L708

Make two separate methods

first one is for saving current price Second one is for updating history

Push last price to history during reading history

AndreyMashukov commented 4 months ago

It will allow us to decrease cpu usage and avoid having duplicated data in redis list