kilimchoi / coingenius

2 stars 0 forks source link

Refactor coin prices calculation #38

Closed timurkhafizov closed 7 years ago

timurkhafizov commented 7 years ago

Part of https://trello.com/c/BINUSz3X/8-refactor-portfolio-controller

Synopsis

This PR drastically increases time of /portfolio page rendering by properly utilizing Redis cached keys. In order to make it working we must populate Redis cache first. The steps which are needed to make it working:

  1. Deploy app
  2. In console run $redis.del($redis.keys('*_price_*'))
  3. In console run Coins::SyncDailyPricesForCoinsWorker.perform_async

Comparison

  1. master branch - https://apm.scoutapp.com/dev_traces/ca892158-e460-4bff-8cf6-73d9cd97c975
  2. This branch - https://apm.scoutapp.com/dev_traces/9343e406-e48d-43f1-a6fb-cf0eac5f5939

Changes